Stylelint

We make use of an automated approach of enforcing CSS code standards. These standards are constantly evolving to ensure we are making use of the best methods, and in order to catch more edge cases ensuring our code is consistent across the board.

Documentationopen in new window

Rules

The following rules are currently configured.

RuleDescriptionLink
unit-no-unknown
warn
Prevents unknown units being used.Linkopen in new window
shorthand-property-no-redundant-values
warn
Disallow redundant values in shorthand properties.Linkopen in new window
property-no-unknown
warn
Prevents unknown properties being used.Linkopen in new window
length-zero-no-unit
warn
Zero lengths should not have units.Linkopen in new window
declaration-no-important
warn
Disallow !important within declarations.Linkopen in new window
declaration-block-no-shorthand-property-overrides
warn
Prevents shorthand properties overriding longhand ones.Linkopen in new window
declaration-block-no-duplicate-properties
warn
Disallow duplicate properties within declaration blocks. This rule ignores variables ($sass, @less, --custom-property).Linkopen in new window
color-no-invalid-hex
warn
Disallow invalid hex colors.Linkopen in new window
color-named
warn
Colors must never be named.Linkopen in new window
color-hex-length
warn
Forces the length of hex codes used in styles to be long notation rather than short.Linkopen in new window
block-no-empty
warn
Disallow empty blocks.Linkopen in new window