postcss-merge-rules (5.1.4)
Published 2026-02-24 14:03:04 +00:00 by atheaadmin
Installation
registry=npm install postcss-merge-rules@5.1.4"postcss-merge-rules": "5.1.4"About this package
postcss-merge-rules
Merge CSS rules with PostCSS.
Install
With npm do:
npm install postcss-merge-rules --save
Examples
This module will attempt to merge adjacent CSS rules:
By declarations
Input
a {
color: blue;
font-weight: bold
}
p {
color: blue;
font-weight: bold
}
Output
a,p {
color: blue;
font-weight: bold
}
By selectors
Input
a {
color: blue
}
a {
font-weight: bold
}
Output
a {
color: blue;
font-weight: bold
}
By partial declarations
Input
a {
font-weight: bold
}
p {
color: blue;
font-weight: bold
}
Output
a,p {
font-weight: bold
}
p {
color: blue
}
Usage
See the PostCSS documentation for examples for your environment.
Contributors
See CONTRIBUTORS.md.
License
MIT © Ben Briggs
Dependencies
Dependencies
| ID | Version |
|---|---|
| browserslist | ^4.21.4 |
| caniuse-api | ^3.0.0 |
| cssnano-utils | ^3.1.0 |
| postcss-selector-parser | ^6.0.5 |
Development Dependencies
| ID | Version |
|---|---|
| @types/caniuse-api | ^3.0.2 |
| postcss | ^8.2.15 |
| postcss-discard-comments | ^5.1.2 |
Peer Dependencies
| ID | Version |
|---|---|
| postcss | ^8.2.15 |
Keywords
css
optimise
postcss
postcss-plugin