A simple javascript utility for calculating z-index
JavaScript
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
spec
.editorconfig
.gitignore
LICENSE
README.md
index.js
package.json
webpack.config.js
yarn.lock

README.md

z-indices

A simple javascript utility for calculating z-index.

Distributed as UMD module.

Installing

$ yarn add z-indices
# or
$ npm install --save z-indices

Usage

Provide configuration dictionary object then pass arrays of keys to calculate z-index.

import zIndices from 'z-indices';

const zIndex = zIndices({
  'foreground': 10,
  'background': 0,
  'popup': 1000
});

zIndex(['foreground', 'popup']); // 1010

Development

  • Run tests: yarn test;
  • Build yarn build;

License

MIT © Dmitriy Semyushkin