Skip to content

Files

Latest commit

 

History

History
62 lines (44 loc) · 1.09 KB

property-whitelist.md

File metadata and controls

62 lines (44 loc) · 1.09 KB

Pattern: Use of non-whitelisted property

Issue: -

Description

Specify a whitelist of allowed properties. This rule ignores variables ($sass, @less, --custom-property).

Examples

array|string: ["array", "of", "unprefixed", "properties" or "regex"]|"property"|"/regex/"

If a string is surrounded with "/" (e.g. "/^background/"), it is interpreted as a regular expression. This allows, for example, easy targeting of shorthands: /^background/ will match background, background-size, background-color, etc.

Given:

["display", "animation", "/^background/"]

The following patterns are considered violations:

a { color: pink; }
a {
  animation: some-animation 2s;
  color: pink;
}
a { borkgrund: orange; }

The following patterns are not considered violations:

a { display: block; }
a { -webkit-animation: some-animation 2s; }
a {
  animation: some-animation 2s;
  -webkit-animation: some-animation 2s;
  display: block;
}
a { background: pink; }
a { background-color: pink; }