1
0
mirror of https://github.com/thangisme/notes.git synced 2024-06-24 13:35:34 +00:00
notes/node_modules/stylelint/lib/rules/declaration-property-unit-blacklist
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00
..
index.js Initial commit 2017-03-09 13:16:08 -05:00
README.md Initial commit 2017-03-09 13:16:08 -05:00

declaration-property-unit-blacklist

Specify a blacklist of disallowed property and unit pairs within declarations.

a { width: 100px; }
/** ↑         ↑
 * These properties and these units */

Options

object: { "unprefixed-property-name": ["array", "of", "units"] }

If a property name is surrounded with "/" (e.g. "/^animation/"), it is interpreted as a regular expression. This allows, for example, easy targeting of shorthands: /^animation/ will match animation, animation-duration, animation-timing-function, etc.

Given:

{
  "font-size": ["em", "px"],
  "/^animation/": ["s"]
}

The following patterns are considered warnings:

a { font-size: 1em; }
a { animation: animation-name 5s ease; }
a { -webkit-animation: animation-name 5s ease; }
a { animation-duration: 5s; }

The following patterns are not considered warnings:

a { font-size: 1.2rem; }
a { height: 100px; }
a { animation: animation-name 500ms ease; }
a { -webkit-animation: animation-name 500ms ease; }
a { animation-duration: 500ms; }