Last change
on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | # [postcss][postcss]-merge-rules
|
---|
| 2 |
|
---|
| 3 | > Merge CSS rules with PostCSS.
|
---|
| 4 |
|
---|
| 5 | ## Install
|
---|
| 6 |
|
---|
| 7 | With [npm](https://npmjs.org/package/postcss-merge-rules) do:
|
---|
| 8 |
|
---|
| 9 | ```
|
---|
| 10 | npm install postcss-merge-rules --save
|
---|
| 11 | ```
|
---|
| 12 |
|
---|
| 13 | ## Examples
|
---|
| 14 |
|
---|
| 15 | This module will attempt to merge *adjacent* CSS rules:
|
---|
| 16 |
|
---|
| 17 | ### By declarations
|
---|
| 18 |
|
---|
| 19 | #### Input
|
---|
| 20 |
|
---|
| 21 | ```css
|
---|
| 22 | a {
|
---|
| 23 | color: blue;
|
---|
| 24 | font-weight: bold
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | p {
|
---|
| 28 | color: blue;
|
---|
| 29 | font-weight: bold
|
---|
| 30 | }
|
---|
| 31 | ```
|
---|
| 32 |
|
---|
| 33 | #### Output
|
---|
| 34 |
|
---|
| 35 | ```css
|
---|
| 36 | a,p {
|
---|
| 37 | color: blue;
|
---|
| 38 | font-weight: bold
|
---|
| 39 | }
|
---|
| 40 | ```
|
---|
| 41 |
|
---|
| 42 | ### By selectors
|
---|
| 43 |
|
---|
| 44 | #### Input
|
---|
| 45 |
|
---|
| 46 | ```css
|
---|
| 47 | a {
|
---|
| 48 | color: blue
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | a {
|
---|
| 52 | font-weight: bold
|
---|
| 53 | }
|
---|
| 54 | ```
|
---|
| 55 |
|
---|
| 56 | #### Output
|
---|
| 57 |
|
---|
| 58 | ```css
|
---|
| 59 | a {
|
---|
| 60 | color: blue;
|
---|
| 61 | font-weight: bold
|
---|
| 62 | }
|
---|
| 63 | ```
|
---|
| 64 |
|
---|
| 65 | ### By partial declarations
|
---|
| 66 |
|
---|
| 67 | #### Input
|
---|
| 68 |
|
---|
| 69 | ```css
|
---|
| 70 | a {
|
---|
| 71 | font-weight: bold
|
---|
| 72 | }
|
---|
| 73 |
|
---|
| 74 | p {
|
---|
| 75 | color: blue;
|
---|
| 76 | font-weight: bold
|
---|
| 77 | }
|
---|
| 78 | ```
|
---|
| 79 |
|
---|
| 80 | #### Output
|
---|
| 81 |
|
---|
| 82 | ```css
|
---|
| 83 | a,p {
|
---|
| 84 | font-weight: bold
|
---|
| 85 | }
|
---|
| 86 |
|
---|
| 87 | p {
|
---|
| 88 | color: blue
|
---|
| 89 | }
|
---|
| 90 | ```
|
---|
| 91 |
|
---|
| 92 | ## Usage
|
---|
| 93 |
|
---|
| 94 | See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
|
---|
| 95 | examples for your environment.
|
---|
| 96 |
|
---|
| 97 | ## Contributors
|
---|
| 98 |
|
---|
| 99 | See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
|
---|
| 100 |
|
---|
| 101 | ## License
|
---|
| 102 |
|
---|
| 103 | MIT © [Ben Briggs](http://beneb.info)
|
---|
| 104 |
|
---|
| 105 | [postcss]: https://github.com/postcss/postcss
|
---|
Note:
See
TracBrowser
for help on using the repository browser.