Skip to main content

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;
}

Correctโ€‹

.layout {
grid-template-areas: "header main";
}

.header {
grid-area: header;
}

.main {
grid-area: main;
}