Releases: ChristianMurphy/postcss-combine-duplicated-selectors
v10.0.3
v10.0.2
Correct typings to do commonjs style export.
Previously typings incorrectly included a default export, which is only supported if esModuleInterop
is enabled.
v10.0.1
updates documentation comments for typescript typings
Postcss 8 and TypeScript typings
Breaking changes:
- postcss 8 is now required
- postcss is now a peer dependency, run
npm install postcss
oryarn add postcss
to ensure it is in your project - TypeScript typings are now provided, these typings build in postcss's own typings and require TypeScript 4 or higher
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
Re-release 9.1.0
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.
Leverage single scan visitor API
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
Support postcss 8.1.0
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
Support keeping fallback values
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);
}
Drop Official Node 8 support, add Node 14 support
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.
Selector Parser Version 6
https://github.com/postcss/postcss-selector-parser/blob/master/CHANGELOG.md#600
drops support for Node 6