项目原始demo,不改动
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Tento repozitář je archivovaný. Můžete prohlížet soubory, klonovat, ale nemůžete nahrávat a vytvářet nové úkoly a požadavky na natažení.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # [postcss][postcss]-reduce-idents [![Build Status](https://travis-ci.org/ben-eb/postcss-reduce-idents.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-reduce-idents.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-reduce-idents.svg)][deps]
  2. > Reduce [custom identifiers][idents] with PostCSS.
  3. ## Install
  4. With [npm](https://npmjs.org/package/postcss-reduce-idents) do:
  5. ```
  6. npm install postcss-reduce-idents --save
  7. ```
  8. ## Example
  9. ### Input
  10. This module will rename custom identifiers in your CSS files; it does so by
  11. converting each name to a index, which is then encoded into a legal identifier.
  12. A legal custom identifier in CSS is case sensitive and must start with a
  13. letter, but can contain digits, hyphens and underscores. There are over 3,000
  14. possible two character identifiers, and 51 possible single character identifiers
  15. that will be generated.
  16. ```css
  17. @keyframes whiteToBlack {
  18. 0% {
  19. color: #fff
  20. }
  21. to {
  22. color: #000
  23. }
  24. }
  25. .one {
  26. animation-name: whiteToBlack
  27. }
  28. ```
  29. ### Output
  30. ```css
  31. @keyframes a {
  32. 0% {
  33. color: #fff
  34. }
  35. to {
  36. color: #000
  37. }
  38. }
  39. .one {
  40. animation-name: a
  41. }
  42. ```
  43. Note that this module does not handle identifiers that are not linked together.
  44. The following example will not be transformed in any way:
  45. ```css
  46. @keyframes fadeOut {
  47. 0% { opacity: 1 }
  48. to { opacity: 0 }
  49. }
  50. .fadeIn {
  51. animation-name: fadeIn;
  52. }
  53. ```
  54. It works for `@keyframes`, `@counter-style`, custom `counter` values and grid area definitions. See the
  55. [documentation][idents] for more information, or the [tests](test.js) for more
  56. examples.
  57. ## Usage
  58. See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
  59. examples for your environment.
  60. ## API
  61. ### reduceIdents([options])
  62. #### options
  63. ##### counter
  64. Type: `boolean`
  65. Default: `true`
  66. Pass `false` to disable reducing `content`, `counter-reset` and `counter-increment` declarations.
  67. ##### keyframes
  68. Type: `boolean`
  69. Default: `true`
  70. Pass `false` to disable reducing `keyframes` rules and `animation` declarations.
  71. ##### counterStyle
  72. Type: `boolean`
  73. Default: `true`
  74. Pass `false` to disable reducing `counter-style` rules and `list-style` and `system` declarations.
  75. ##### gridTemplate
  76. Type: `boolean`
  77. Default: `true`
  78. Pass `false` to disable reducing `grid-template`, `grid-area` and `grid-template-areas` declarations.
  79. ##### encoder
  80. Type: `function`
  81. Default: [`lib/encode.js`](https://github.com/ben-eb/postcss-reduce-idents/blob/master/src/lib/encode.js)
  82. Pass a custom function to encode the identifier with (e.g.: as a way of prefixing them automatically).
  83. It receives two parameters:
  84. - A `String` with the node value.
  85. - A `Number` identifying the index of the occurrence.
  86. ## Contributors
  87. Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
  88. <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
  89. | [<img src="https://avatars.githubusercontent.com/u/1282980?v=3" width="100px;"/><br /><sub>Ben Briggs</sub>](http://beneb.info)<br />[💻](https://github.com/ben-eb/postcss-reduce-idents/commits?author=ben-eb) [📖](https://github.com/ben-eb/postcss-reduce-idents/commits?author=ben-eb) 👀 [⚠️](https://github.com/ben-eb/postcss-reduce-idents/commits?author=ben-eb) | [<img src="https://avatars.githubusercontent.com/u/5635476?v=3" width="100px;"/><br /><sub>Bogdan Chadkin</sub>](https://github.com/TrySound)<br />[⚠️](https://github.com/ben-eb/postcss-reduce-idents/commits?author=TrySound) [💻](https://github.com/ben-eb/postcss-reduce-idents/commits?author=TrySound) | [<img src="https://avatars.githubusercontent.com/u/13041?v=3" width="100px;"/><br /><sub>Guillermo Rauch</sub>](http://twitter.com/rauchg)<br />[💻](https://github.com/ben-eb/postcss-reduce-idents/commits?author=rauchg) [📖](https://github.com/ben-eb/postcss-reduce-idents/commits?author=rauchg) [⚠️](https://github.com/ben-eb/postcss-reduce-idents/commits?author=rauchg) | [<img src="https://avatars.githubusercontent.com/u/566536?v=3" width="100px;"/><br /><sub>Sylvain Pollet-Villard</sub>](https://github.com/sylvainpolletvillard)<br />[💻](https://github.com/ben-eb/postcss-reduce-idents/commits?author=sylvainpolletvillard) [📖](https://github.com/ben-eb/postcss-reduce-idents/commits?author=sylvainpolletvillard) [⚠️](https://github.com/ben-eb/postcss-reduce-idents/commits?author=sylvainpolletvillard) |
  90. | :---: | :---: | :---: | :---: |
  91. <!-- ALL-CONTRIBUTORS-LIST:END -->
  92. This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
  93. ## License
  94. MIT © [Ben Briggs](http://beneb.info)
  95. [ci]: https://travis-ci.org/ben-eb/postcss-reduce-idents
  96. [deps]: https://gemnasium.com/ben-eb/postcss-reduce-idents
  97. [idents]: https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident
  98. [npm]: http://badge.fury.io/js/postcss-reduce-idents
  99. [postcss]: https://github.com/postcss/postcss