Skip to content

Files

Latest commit

 

History

History
83 lines (61 loc) · 967 Bytes

unit-no-unknown.md

File metadata and controls

83 lines (61 loc) · 967 Bytes

Pattern: Unknown unit

Issue: -

Description

Disallow unknown units. This rule considers units defined in the CSS Specifications, up to and including Editor's Drafts, to be known.

Examples

The following patterns are considered violations:

a { width: 100pixels; }
/**           ↑
 *  These units */
a {
  width: calc(10px + 10pixels);
}

The following patterns are not considered violations:

a {
  width: 10px;
}  
a {
  width: 10Px;
}  
a {
  width: 10pX;
}  
a {
  width: calc(10px + 10px);
}

Configuration

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

Given:

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

The following patterns are not considered violations:

a {
  width: 10custom;
}
a {
  width: 10some-unit;
}
a {
  width: 10some-other-unit;
}

Further Reading