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.

87 lines
1.5 KiB

4 years 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: 0;
  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. ## Usage
  44. See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
  45. examples for your environment.
  46. ## Contributors
  47. See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
  48. ## License
  49. [Template:CSSData] by Mozilla Contributors is licensed under [CC-BY-SA 2.5].
  50. [Template:CSSData]: https://developer.mozilla.org/en-US/docs/Template:CSSData
  51. [CC-BY-SA 2.5]: http://creativecommons.org/licenses/by-sa/2.5/
  52. MIT © [Ben Briggs](http://beneb.info)
  53. [postcss]: https://github.com/postcss/postcss