Skip to content

named-grid-areas-no-invalid

Reports a grid-template-areas whose rows differ in length, are empty, or hold an area that is not a rectangle.

The browser drops the whole grid-template-areas declaration when its table is not a rectangle of named cells, and every item placed by area then falls into an automatic cell.

To fix, give every row the same number of cells and make each area a rectangle.

Reported
:root { --x: 1; --y: 2 }
...
b { grid-template-areas: "a b" "a" }
c { grid-template-areas: "a a" "b a" }
d { grid-template-areas: "a b" "c d" }
css:
lint:
rules:
named-grid-areas-no-invalid: warn # off (default), warn, error
less:
lint:
rules:
named-grid-areas-no-invalid: warn # off (default), warn, error
scss:
lint:
rules:
named-grid-areas-no-invalid: warn # off (default), warn, error

Enabled by the presets: css/stylelint-recommended.

Suppress one line with sudsy-disable-next-line named-grid-areas-no-invalid in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
stylelint named-grid-areas-no-invalid full