Skip to main content

validate-area-shapes

Require every named grid template area to form one contiguous rectangle.

CSS Grid rejects non-rectangular areas. This rule catches the problem at the authored template declaration instead of leaving it to browser behavior.

Incorrectโ€‹

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

Correctโ€‹

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

Stylelint Configโ€‹

export default {
plugins: ["stylelint-plugin-grid"],
rules: {
"grid/validate-area-shapes": true
}
};