CSS Rules
Below the list of rules supported by Biome, divided by group. Here’s a legend of the emojis:
- The icon indicates that the rule is part of the recommended rules.
- The icon indicates that the rule provides a code action (fix) that is safe to apply.
- The icon indicates that the rule provides a code action (fix) that is unsafe to apply.
- The icon indicates that the rule is currently only available in the 2.0 beta release.
| Rule name | Description | Properties |
|---|---|---|
| useGenericFontNames | Disallow a missing generic family keyword within font families. |
correctness
Section titled correctness| Rule name | Description | Properties |
|---|---|---|
| noInvalidDirectionInLinearGradient | Disallow non-standard direction values for linear gradient functions. | |
| noInvalidGridAreas | Disallows invalid named grid areas in CSS Grid Layouts. | |
| noInvalidPositionAtImportRule | Disallow the use of @import at-rules in invalid positions. | |
| noUnknownFunction | Disallow unknown CSS value functions. | |
| noUnknownMediaFeatureName | Disallow unknown media feature names. | |
| noUnknownProperty | Disallow unknown properties. | |
| noUnknownUnit | Disallow unknown CSS units. | |
| noUnmatchableAnbSelector | Disallow unmatchable An+B selectors. |
nursery
Section titled nursery| Rule name | Description | Properties |
|---|---|---|
| noDescendingSpecificity | Disallow a lower specificity selector from coming after a higher specificity selector. | |
| noDuplicateCustomProperties | Disallow duplicate custom properties within declaration blocks. | |
| noDuplicateProperties | Disallow duplicate properties within declaration blocks. | |
| noIrregularWhitespace | Disallows the use of irregular whitespace characters. | |
| noMissingVarFunction | Disallow missing var function for css variables. | |
| noUnknownAtRule | Disallow unknown at-rules. | |
| noUnknownPseudoClass | Disallow unknown pseudo-class selectors. | |
| noUnknownPseudoElement | Disallow unknown pseudo-element selectors. | |
| noUnknownTypeSelector | Disallow unknown type selectors. | |
| noUselessEscapeInString | Disallow unnecessary escapes in string literals. | |
| noValueAtRule | Disallow use of @value rule in css modules. |
suspicious
Section titled suspicious| Rule name | Description | Properties |
|---|---|---|
| noDuplicateAtImportRules | Disallow duplicate @import rules. | |
| noDuplicateFontNames | Disallow duplicate names within font families. | |
| noDuplicateSelectorsKeyframeBlock | Disallow duplicate selectors within keyframe blocks. | |
| noEmptyBlock | Disallow CSS empty blocks. | |
| noImportantInKeyframe | Disallow invalid !important within keyframe declarations | |
| noShorthandPropertyOverrides | Disallow shorthand properties that override related longhand properties. |
Recommended rules
Section titled Recommended rules- useGenericFontNames (Severity: Error)
- noInvalidDirectionInLinearGradient (Severity: Error)
- noInvalidGridAreas (Severity: Error)
- noInvalidPositionAtImportRule (Severity: Error)
- noUnknownFunction (Severity: Error)
- noUnknownMediaFeatureName (Severity: Error)
- noUnknownProperty (Severity: Error)
- noUnknownUnit (Severity: Error)
- noUnmatchableAnbSelector (Severity: Error)
- noDuplicateAtImportRules (Severity: Error)
- noDuplicateFontNames (Severity: Error)
- noDuplicateSelectorsKeyframeBlock (Severity: Error)
- noEmptyBlock (Severity: Error)
- noImportantInKeyframe (Severity: Error)
- noShorthandPropertyOverrides (Severity: Error)