no-unused-areas
Disallow named template areas that are never referenced by a single-name
grid-area declaration in the same stylesheet.
This rule is intentionally not recommended by default. It is useful when grid containers and grid items are authored together, but it can be noisy when templates and items live in separate files.
Incorrectโ
.layout {
grid-template-areas: "header main";
}
.main {
grid-area: main;
}
Related Rulesโ
no-unknown-areascatches item assignments that do not exist in any same-stylesheet template.no-overlapping-areascatches duplicate single-name assignments.grid-allenables this stricter same-stylesheet rule.
Correctโ
.layout {
grid-template-areas: "header main";
}
.header {
grid-area: header;
}
.main {
grid-area: main;
}