stylelint-no-z-index

1.1.2 • Public • Published

stylelint-no-z-index

Stylelint rule for preventing the use of z-index

Install

npm install --save-dev stylelint-no-z-index

Usage

// .stylelintrc
{
  "plugins": [
    "stylelint-no-z-index"
  ],
  "rules": {
   // ...
   "plugin/no-z-index": 2,
   // ...
  }
}

Example of rules that will pass the linting:

.foo {
   background: red;
}

.foo {
   z-index: auto;
}

.foo {
   z-index: inherit;
}

.foo {
   z-index: initial;
}

.foo {
   z-index: unset;
}

.foo {
   z-index: var(--z-index--default);
}

Example of rules that won't pass the linting:

.foo {
  z-index: -1;
}

.foo {
  z-index: 0;
}

.foo {
  z-index: 100;
}

Package Sidebar

Install

npm i stylelint-no-z-index

Weekly Downloads

154

Version

1.1.2

License

MIT

Last publish

Collaborators

  • marcelloromanelli