You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
1.7 KiB

3 months ago
  1. # [postcss][postcss]-reduce-initial
  2. > Reduce `initial` definitions to the _actual_ initial value, where possible.
  3. ## Install
  4. With [npm](https://npmjs.org/package/postcss-reduce-initial) do:
  5. ```
  6. npm install postcss-reduce-initial --save
  7. ```
  8. ## Examples
  9. See the [data](data) for more conversions. This data is courtesy
  10. of Mozilla.
  11. ### Convert `initial` values
  12. When the `initial` keyword is longer than the property value, it will
  13. be converted:
  14. #### Input
  15. ```css
  16. h1 {
  17. min-width: initial;
  18. }
  19. ```
  20. #### Output
  21. ```css
  22. h1 {
  23. min-width: auto;
  24. }
  25. ```
  26. ### Convert values back to `initial`
  27. When the `initial` value is smaller than the property value, it will
  28. be converted:
  29. #### Input
  30. ```css
  31. h1 {
  32. transform-box: border-box;
  33. }
  34. ```
  35. #### Output
  36. ```css
  37. h1 {
  38. transform-box: initial;
  39. }
  40. ```
  41. This conversion is only applied when you supply a browsers list that all support
  42. the `initial` keyword; it's worth noting that Internet Explorer has no support.
  43. ## API
  44. ### reduceInitial([options])
  45. #### options
  46. ##### ignore
  47. Type: `Array<String>`
  48. Default: `undefined`
  49. It contains the Array of properties that will be ignored while reducing its value to initial.
  50. Example : `{ ignore : ["min-height"] }`
  51. ## Usage
  52. See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
  53. examples for your environment.
  54. ## Contributors
  55. See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
  56. ## License
  57. This program uses a list of CSS properties derived from data maintained my the MDN team at Mozilla and licensed under the [CC0 1.0 Universal Public Domain Dedication](https://creativecommons.org/publicdomain/zero/1.0/).
  58. MIT © [Ben Briggs](http://beneb.info)
  59. [postcss]: https://github.com/postcss/postcss