You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.2 KiB

4 years ago
  1. # [postcss][postcss]-discard-duplicates
  2. > Discard duplicate rules in your CSS files with PostCSS.
  3. ## Install
  4. With [npm](https://npmjs.org/package/postcss-discard-duplicates) do:
  5. ```
  6. npm install postcss-discard-duplicates --save
  7. ```
  8. ## Example
  9. This module will remove all duplicate rules from your stylesheets. It works on
  10. at rules, normal rules and declarations. Note that this module does not have any
  11. responsibility for normalising declarations, selectors or whitespace, so that it
  12. considers these two rules to be different:
  13. ```css
  14. h1, h2 {
  15. color: blue;
  16. }
  17. h2, h1 {
  18. color: blue;
  19. }
  20. ```
  21. It has to assume that your rules have already been transformed by another
  22. processor, otherwise it would be responsible for too many things.
  23. ### Input
  24. ```css
  25. h1 {
  26. margin: 0 auto;
  27. margin: 0 auto
  28. }
  29. h1 {
  30. margin: 0 auto
  31. }
  32. ```
  33. ### Output
  34. ```css
  35. h1 {
  36. margin: 0 auto
  37. }
  38. ```
  39. ## Usage
  40. See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
  41. examples for your environment.
  42. ## Contributors
  43. See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
  44. ## License
  45. MIT © [Ben Briggs](http://beneb.info)
  46. [postcss]: https://github.com/postcss/postcss