postcss-zindex
Advanced tools
Comparing version 5.0.1 to 5.0.2
{ | ||
"name": "postcss-zindex", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Reduce z-index values with PostCSS.", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"prebuild": "del-cli dist", | ||
"build": "cross-env BABEL_ENV=publish babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"", | ||
"prepublish": "yarn build" | ||
}, | ||
"main": "src/index.js", | ||
"files": [ | ||
"LICENSE-MIT", | ||
"dist" | ||
"src" | ||
], | ||
@@ -44,3 +39,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "28c247175032fa03f04911cde56ad82d74d211cc" | ||
} | ||
"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" | ||
} |
8212
5
68