Skip to content

Files

Latest commit

 

History

History
128 lines (94 loc) · 1.67 KB

property-no-unknown.md

File metadata and controls

128 lines (94 loc) · 1.67 KB

Pattern: Unknown CSS property

Issue: -

Description

This rule considers properties defined in the CSS Specifications and browser specific properties to be known.

This rule ignores variables ($sass, @less, --custom-property).

This rule ignores vendor-prefixed properties (e.g., -moz-align-self, -webkit-align-self). Use option checkPrefixed described below to turn on checking of vendor-prefixed properties.

Examples

The following patterns are considered violations:

a {
  colr: blue;
}
a {
  some-property: 1;
}

The following patterns are not considered violations:

a {
  color: green;
}
a {
  fill: black;
}
a {
  -moz-align-self: center;
}
a {
  -webkit-align-self: center;
}
a {
  align-self: center;
}

Configuration

ignoreProperties: ["/regex/", "string"]

Given:

["/^some-/", "custom"]

The following patterns are not considered violations:

a {
  some-property: 10px;
}
a {
  some-other-property: 10px;
}
a {
  custom: 10px;
}

checkPrefixed: true | false (default: false)

If true, this rule will check vendor-prefixed properties.

For example with true:

The following patterns are not considered violations:

a {
  -webkit-overflow-scrolling: auto;
}
a {
  -moz-box-flex: 0;
}

The following patterns are considered violations:

a {
  -moz-align-self: center;
}
a {
  -moz-overflow-scrolling: center;
}

Further Reading