中文: README-cn.md
PostCSS plugin for delete duplicate css in the file.
This plugin will not change the original css file, but delete the duplicate styles when packaging
Write this:
.foo {
width: 100px;
height: 100px;
}
.foo{
height: 100px;
width: 100px;
}And get this:
.foo {
width: 100px;
height: 100px;
}$ npm install postcss-delete-duplicate-css
postcss([ require('postcss-delete-duplicate-css') ])See PostCSS docs for examples regarding usage.
- Type:
boolean - Default:
false
Whether to delete empty styles
Write this:
.foo {
width: 100px;
}
div {}And get this:
.foo{
width: 100px
}- Type:
boolean - Default:
false
Whether to delete all comments
Write this:
/*This is the comment*/
div {
width: 100px;
height: 100px;
}And get this:
div {
width: 100px;
height: 100px
}Tests can be run via the following command:
$ npm run test