e8fa5e159ed80e21aa38793d08e2bcd59fdc72bda3dec9245cf633f8221de82697f18d59d805e7504116942a2614de0e67b80e62e375c5163e507420060297 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # [postcss][postcss]-merge-rules
  2. > Merge CSS rules with PostCSS.
  3. ## Install
  4. With [npm](https://npmjs.org/package/postcss-merge-rules) do:
  5. ```
  6. npm install postcss-merge-rules --save
  7. ```
  8. ## Examples
  9. This module will attempt to merge *adjacent* CSS rules:
  10. ### By declarations
  11. #### Input
  12. ```css
  13. a {
  14. color: blue;
  15. font-weight: bold
  16. }
  17. p {
  18. color: blue;
  19. font-weight: bold
  20. }
  21. ```
  22. #### Output
  23. ```css
  24. a,p {
  25. color: blue;
  26. font-weight: bold
  27. }
  28. ```
  29. ### By selectors
  30. #### Input
  31. ```css
  32. a {
  33. color: blue
  34. }
  35. a {
  36. font-weight: bold
  37. }
  38. ```
  39. #### Output
  40. ```css
  41. a {
  42. color: blue;
  43. font-weight: bold
  44. }
  45. ```
  46. ### By partial declarations
  47. #### Input
  48. ```css
  49. a {
  50. font-weight: bold
  51. }
  52. p {
  53. color: blue;
  54. font-weight: bold
  55. }
  56. ```
  57. #### Output
  58. ```css
  59. a,p {
  60. font-weight: bold
  61. }
  62. p {
  63. color: blue
  64. }
  65. ```
  66. ## Usage
  67. See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
  68. examples for your environment.
  69. ## Contributors
  70. See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
  71. ## License
  72. MIT © [Ben Briggs](http://beneb.info)
  73. [postcss]: https://github.com/postcss/postcss