Skip to main content

List of rules

The built-in rules help you:

There are also frozen rules that let you address stylistic issues.

Within each cateogory, the rules are grouped by the thing they apply to.

Avoid errors

Color

Font family

Named grid areas

Function

String

Unit

Custom property

Property

Keyframe declaration

Keyframe block

Declaration block

Block

Selector

Media feature

At-rule

Comment

General / Sheet

Enforce conventions

Alpha-value

Hue

Color

Length

Font family

  • font-family-name-quotes: Specify whether or not quotation marks should be used around font family names (Autofixable).

Font weight

  • font-weight-notation: Require numeric or named (where possible) font-weight values. Also, when named values are expected, require only valid names.

Function

Keyframes

Number

Time

Unit

Shorthand property

Value

Custom property

Property

Declaration

Declaration block

Selector

Rules

Media feature

Custom media

At-rule

Comment

General / Sheet

Stylistic issues

We have frozen these rules — we won't fix bugs nor add options, and we will deprecate then remove them in future releases. We recommend you use a pretty printer (like Prettier) alongside Stylelint rather than these rules. If you prefer to use Stylelint to enforce stylistic consistency, you can migrate the rules you need to a plugin.

Not handled by pretty printers

Value

Function

Custom property

Selector

Rule

At-rule

Comment

Handled by pretty printers

Color

  • color-hex-case: Specify lowercase or uppercase for hex colors (Autofixable).

Function

Number

String

  • string-quotes: Specify single or double quotes around strings (Autofixable).

Unit

  • unit-case: Specify lowercase or uppercase for units (Autofixable).

Value list

Property

  • property-case: Specify lowercase or uppercase for properties (Autofixable).

Declaration

Declaration block

Block

Selector

Selector list

Media feature

Media query list

At-rule

General / Sheet