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.
Rules
The following rules are currently configured.
Rule | Description | Link |
---|---|---|
unit-no-unknown warn | Prevents unknown units being used. | Link |
shorthand-property-no-redundant-values warn | Disallow redundant values in shorthand properties. | Link |
property-no-unknown warn | Prevents unknown properties being used. | Link |
length-zero-no-unit warn | Zero lengths should not have units. | Link |
declaration-no-important warn | Disallow !important within declarations. | Link |
declaration-block-no-shorthand-property-overrides warn | Prevents shorthand properties overriding longhand ones. | Link |
declaration-block-no-duplicate-properties warn | Disallow duplicate properties within declaration blocks. This rule ignores variables ($sass, @less, --custom-property). | Link |
color-no-invalid-hex warn | Disallow invalid hex colors. | Link |
color-named warn | Colors must never be named. | Link |
color-hex-length warn | Forces the length of hex codes used in styles to be long notation rather than short. | Link |
block-no-empty warn | Disallow empty blocks. | Link |