automatically keep css selectors unique.
MIT License
Published by ChristianMurphy about 4 years ago
9.2.0 and 9.3.0 unintentionally included potentially breaking changes, this re-releases 9.1.0 as 9.4.0 to minimize impact to adopters using a minor (^9
) version range in their package.json.
Published by ChristianMurphy about 4 years ago
Breaking changes:
npm install postcss
or yarn add postcss
to ensure it is in your projectpostcss-combine-duplicated-selectors now leverages the postcss single scan visitor API.
This has a few implications:
- With new API, all plugins can share a single scan of the CSS tree. It makes CSS processing up to 20% faster.
- Plugins will re-visit changed nodes to reduce compatibility issues between plugins. Now the order of plugins in your PostCSS config will be less important.
source: https://github.com/postcss/postcss/releases/tag/8.0.0
Published by ChristianMurphy about 4 years ago
⚠️ this release unintentionally contains breaking changes, please upgrade directly to version 10, or hold at versio 9.1.0 if that is not possible ⚠️
postcss-combine-duplicated-selectors now leverages the postcss single scan visitor API.
This has a few implications:
- With new API, all plugins can share a single scan of the CSS tree. It makes CSS processing up to 20% faster.
- Plugins will re-visit changed nodes to reduce compatibility issues between plugins. Now the order of plugins in your PostCSS config will be less important.
source: https://github.com/postcss/postcss/releases/tag/8.0.0
For more information on the new tree walking API see: https://evilmartians.com/chronicles/postcss-8-plugin-migration#step-3-take-the-most-out-of-the-new-api and https://github.com/postcss/postcss/releases/tag/8.0.0
Published by ChristianMurphy about 4 years ago
⚠️ this release unintentionally contains breaking changes, please upgrade directly to version 10, or hold at versio 9.1.0 if that is not possible ⚠️
postcss 8.1.0 renamed the visitor postcss-combine-duplicated-selectors depends on (Root
to Once
).
This release updates to the new visitor, and requires postcss 8.1.0 and above.
Note: postcss is now a peer dependency if it is not directly installed already, please run npm install postcss
Published by ChristianMurphy about 4 years ago
A new option removeDuplicatedValues
has been added. (#534 thanks @MoltenCoffee)
In order to limit this to only combining properties when the values are equal, set the removeDuplicatedValues
option to true instead. This could clean up duplicated properties, but allow for conscious duplicates such as fallbacks for custom properties.
const postcss = require('postcss');
const combineSelectors = require('postcss-combine-duplicated-selectors');
postcss([combineSelectors({removeDuplicatedValues: true})]);
This will transform the following css
.a {
height: 10px;
}
.a {
width: 20px;
background: var(--custom-color);
background: rgba(255, 165, 0, 0.5);
}
into
.a {
height: 10px;
width: 20px;
background: var(--custom-color);
background: rgba(255, 165, 0, 0.5);
}
Published by ChristianMurphy over 4 years ago
Node 8 may still work, but it is no longer a part of the CI tests and is not officially supported.
Node 14 is now officially supported.
Published by ChristianMurphy over 5 years ago
https://github.com/postcss/postcss-selector-parser/blob/master/CHANGELOG.md#600
drops support for Node 6
Published by ChristianMurphy almost 6 years ago
Published by ChristianMurphy about 6 years ago
Groups of css selectors that are logically the same will now be combined (#247 thanks @r-wettstaedt!)
.one .two, .one .three {} .one .three, .one .two {}
/* becomes */
.one .two, .one .three {}
Published by ChristianMurphy over 6 years ago
Remove Node.js 9 and Node.js 4 support
Remove IE and “dead” browsers support
https://github.com/postcss/postcss/blob/master/CHANGELOG.md#70-president-amy
Published by ChristianMurphy over 6 years ago
Published by ChristianMurphy over 6 years ago
Documentation has been updated to reflect new PostCSS command line usage. (#148 thanks to @ItsEddie)
Published by ChristianMurphy almost 7 years ago
When using postcss-combine-duplicated-selectors
with postcss-nested
selectors, @font-face
now bubbles to the top level, changing how selectors will be combined.
See: https://github.com/postcss/postcss-nested/blob/master/CHANGELOG.md#30
Published by ChristianMurphy almost 7 years ago
Published by ChristianMurphy almost 7 years ago
Published by ChristianMurphy almost 7 years ago
No new features in postcss-combine-duplicated-selectors, just improvements in the underlying technology.
Published by ChristianMurphy about 7 years ago
Explicit Node.js version 6 support has been re-added to package.json engines