1 | # [postcss][postcss]-merge-idents [![Build Status](https://travis-ci.org/ben-eb/postcss-merge-idents.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-merge-idents.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-merge-idents.svg)][deps]
|
2 |
|
3 | > Merge keyframe and counter style identifiers.
|
4 |
|
5 |
|
6 | ## Install
|
7 |
|
8 | With [npm](https://npmjs.org/package/postcss-merge-idents) do:
|
9 |
|
10 | ```
|
11 | npm install postcss-merge-idents --save
|
12 | ```
|
13 |
|
14 |
|
15 | ## Example
|
16 |
|
17 | This module will merge identifiers such as `@keyframes` and `@counter-style`,
|
18 | if their properties are identical. Then, it will update those declarations that
|
19 | depend on the duplicated property.
|
20 |
|
21 | ### Input
|
22 |
|
23 | ```css
|
24 | @keyframes rotate {
|
25 | from { transform: rotate(0) }
|
26 | to { transform: rotate(360deg) }
|
27 | }
|
28 |
|
29 | @keyframes flip {
|
30 | from { transform: rotate(0) }
|
31 | to { transform: rotate(360deg) }
|
32 | }
|
33 |
|
34 | .rotate {
|
35 | animation-name: rotate
|
36 | }
|
37 |
|
38 | .flip {
|
39 | animation-name: flip
|
40 | }
|
41 | ```
|
42 |
|
43 | ### Output
|
44 |
|
45 | ```css
|
46 | @keyframes flip {
|
47 | from { transform: rotate(0) }
|
48 | to { transform: rotate(360deg) }
|
49 | }
|
50 |
|
51 | .rotate {
|
52 | animation-name: flip
|
53 | }
|
54 |
|
55 | .flip {
|
56 | animation-name: flip
|
57 | }
|
58 | ```
|
59 |
|
60 |
|
61 | ## Usage
|
62 |
|
63 | See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
|
64 | examples for your environment.
|
65 |
|
66 |
|
67 | ## Contributing
|
68 |
|
69 | Pull requests are welcome. If you add functionality, then please add unit tests
|
70 | to cover it.
|
71 |
|
72 |
|
73 | ## License
|
74 |
|
75 | MIT © [Ben Briggs](http://beneb.info)
|
76 |
|
77 |
|
78 | [ci]: https://travis-ci.org/ben-eb/postcss-merge-idents
|
79 | [deps]: https://gemnasium.com/ben-eb/postcss-merge-idents
|
80 | [npm]: http://badge.fury.io/js/postcss-merge-idents
|
81 | [postcss]: https://github.com/postcss/postcss
|