https://github.com/mcler/postcss-discard-overridden-props
PostCSS plugin, which discards overridden properties in every CSS rule.
https://github.com/mcler/postcss-discard-overridden-props
postcss postcss-plugin postcss-plugins
Last synced: 3 months ago
JSON representation
PostCSS plugin, which discards overridden properties in every CSS rule.
- Host: GitHub
- URL: https://github.com/mcler/postcss-discard-overridden-props
- Owner: mcler
- License: mit
- Created: 2018-07-04T15:09:16.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-06-15T16:07:44.000Z (about 5 years ago)
- Last Synced: 2025-03-30T13:36:49.880Z (over 1 year ago)
- Topics: postcss, postcss-plugin, postcss-plugins
- Language: JavaScript
- Size: 37.1 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# postcss-discard-overridden-rules
PostCSS plugin, which discards overridden properties in every CSS rule.
## Example
### Input
```css
.rule1 {
color: red;
display: block;
display: inline;
}
.rule2 {
color: green;
display: block !important;
display: inline;
}
.rule3 {
color: blue;
display: block;
display: inline !important;
}
@media (max-width: 120px) {
.rule4 {
color: blue;
display: block;
display: inline !important;
}
}
```
### Output
```css
.rule1 {
color: red;
display: inline;
}
.rule2 {
color: green;
display: block !important;
}
.rule3 {
color: blue;
display: inline !important;
}
@media (max-width: 120px) {
.rule4 {
color: blue;
display: inline !important;
}
}
```
## Options
* `log` (default: `false`) a logging flag.
* `noDelete` (default: `false`) a flag whether found overridden properties will be deleted (works only with `log` set to `true`).
* `ignorePrefix` (default: `false`) a flag whether plugin ignores prefixed properties and values.
* `props` (default: `false`) an array of string with properies allowed to proccess by plugin.