|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.7 KB
|
| Line | |
|---|
| 1 | # [postcss][postcss]-reduce-initial
|
|---|
| 2 |
|
|---|
| 3 | > Reduce `initial` definitions to the _actual_ initial value, where possible.
|
|---|
| 4 |
|
|---|
| 5 | ## Install
|
|---|
| 6 |
|
|---|
| 7 | With [npm](https://npmjs.org/package/postcss-reduce-initial) do:
|
|---|
| 8 |
|
|---|
| 9 | ```
|
|---|
| 10 | npm install postcss-reduce-initial --save
|
|---|
| 11 | ```
|
|---|
| 12 |
|
|---|
| 13 | ## Examples
|
|---|
| 14 |
|
|---|
| 15 | See the [data](data) for more conversions. This data is courtesy
|
|---|
| 16 | of Mozilla.
|
|---|
| 17 |
|
|---|
| 18 | ### Convert `initial` values
|
|---|
| 19 |
|
|---|
| 20 | When the `initial` keyword is longer than the property value, it will
|
|---|
| 21 | be converted:
|
|---|
| 22 |
|
|---|
| 23 | #### Input
|
|---|
| 24 |
|
|---|
| 25 | ```css
|
|---|
| 26 | h1 {
|
|---|
| 27 | min-width: initial;
|
|---|
| 28 | }
|
|---|
| 29 | ```
|
|---|
| 30 |
|
|---|
| 31 | #### Output
|
|---|
| 32 |
|
|---|
| 33 | ```css
|
|---|
| 34 | h1 {
|
|---|
| 35 | min-width: auto;
|
|---|
| 36 | }
|
|---|
| 37 | ```
|
|---|
| 38 |
|
|---|
| 39 | ### Convert values back to `initial`
|
|---|
| 40 |
|
|---|
| 41 | When the `initial` value is smaller than the property value, it will
|
|---|
| 42 | be converted:
|
|---|
| 43 |
|
|---|
| 44 | #### Input
|
|---|
| 45 |
|
|---|
| 46 | ```css
|
|---|
| 47 | h1 {
|
|---|
| 48 | transform-box: border-box;
|
|---|
| 49 | }
|
|---|
| 50 | ```
|
|---|
| 51 |
|
|---|
| 52 | #### Output
|
|---|
| 53 |
|
|---|
| 54 | ```css
|
|---|
| 55 | h1 {
|
|---|
| 56 | transform-box: initial;
|
|---|
| 57 | }
|
|---|
| 58 | ```
|
|---|
| 59 |
|
|---|
| 60 | This conversion is only applied when you supply a browsers list that all support
|
|---|
| 61 | the `initial` keyword; it's worth noting that Internet Explorer has no support.
|
|---|
| 62 |
|
|---|
| 63 | ## API
|
|---|
| 64 |
|
|---|
| 65 | ### reduceInitial([options])
|
|---|
| 66 |
|
|---|
| 67 | #### options
|
|---|
| 68 |
|
|---|
| 69 | ##### ignore
|
|---|
| 70 |
|
|---|
| 71 | Type: `Array<String>`
|
|---|
| 72 | Default: `undefined`
|
|---|
| 73 |
|
|---|
| 74 | It contains the Array of properties that will be ignored while reducing its value to initial.
|
|---|
| 75 | Example : `{ ignore : ["min-height"] }`
|
|---|
| 76 |
|
|---|
| 77 | ## Usage
|
|---|
| 78 |
|
|---|
| 79 | See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
|
|---|
| 80 | examples for your environment.
|
|---|
| 81 |
|
|---|
| 82 | ## Contributors
|
|---|
| 83 |
|
|---|
| 84 | See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
|
|---|
| 85 |
|
|---|
| 86 | ## License
|
|---|
| 87 |
|
|---|
| 88 | 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/).
|
|---|
| 89 |
|
|---|
| 90 | MIT © [Ben Briggs](http://beneb.info)
|
|---|
| 91 |
|
|---|
| 92 | [postcss]: https://github.com/postcss/postcss
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.