UNPKG

1.65 kBMarkdownView Raw
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
8With [npm](https://npmjs.org/package/postcss-merge-idents) do:
9
10```
11npm install postcss-merge-idents --save
12```
13
14
15## Example
16
17This module will merge identifiers such as `@keyframes` and `@counter-style`,
18if their properties are identical. Then, it will update those declarations that
19depend 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
63See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
64examples for your environment.
65
66
67## Contributing
68
69Pull requests are welcome. If you add functionality, then please add unit tests
70to cover it.
71
72
73## License
74
75MIT © [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