postcss-zindex
Advanced tools
Comparing version 5.1.0 to 6.0.0
{ | ||
"name": "postcss-zindex", | ||
"version": "5.1.0", | ||
"version": "6.0.0", | ||
"description": "Reduce z-index values with PostCSS.", | ||
@@ -33,3 +33,3 @@ "main": "src/index.js", | ||
"engines": { | ||
"node": "^10 || ^12 || >=14.0" | ||
"node": "^14 || ^16 || >=18.0" | ||
}, | ||
@@ -41,4 +41,3 @@ "devDependencies": { | ||
"postcss": "^8.2.15" | ||
}, | ||
"readme": "# [postcss][postcss]-zindex\n\n> Reduce z-index values with PostCSS.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-zindex) do:\n\n```\nnpm install postcss-zindex --save\n```\n\n## Example\n\nSometimes, you may introduce z-index values into your CSS that are larger than\nnecessary, in order to improve your understanding of how each stack relates to\nthe others. For example, you might have a modal overlay at `5000` and the dialog\nfor it at `5500` - so that modal classes occupy the `5xxx` space.\n\nBut in production, it is unnecessary to use such large values for z-index where\nsmaller values would suffice. This module will reduce all z-index declarations\nwhilst respecting your original intent; such that the overlay becomes `1` and\nthe dialog becomes `2`. For more examples, see the [tests](test.js).\n\n### Input\n\n```css\n.modal {\n z-index: 5000\n}\n\n.modal-overlay {\n z-index: 5500\n}\n```\n\n### Output\n\n```css\n.modal {\n z-index: 1\n}\n\n.modal-overlay {\n z-index: 2\n}\n```\n\nNote that this module does not attempt to normalize relative z-index values,\nsuch as `-1`; indeed, it will abort immediately when encountering these values\nas it cannot be sure that rebasing mixed positive & negative values will keep\nthe stacking context intact. Be careful with using this module alongside\nJavaScript injected CSS; ideally you should have already extracted all of your\nstacking context into CSS.\n\n## API\n\n### zindex([options])\n\n#### options\n\n##### startIndex\n\nType: `number`\nDefault: `1`\n\nSet this to any other positive integer if you want to override z-indices from\nother sources outside your control. For example if a third party widget has a\nmaximum z-index of `99`, you can set this to `100` and not have to worry about\nstacking conflicts.\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n[postcss]: https://github.com/postcss/postcss\n" | ||
} | ||
} |
7438