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
}
};
Related Rulesโ
no-invalid-areascatches malformed template strings before shape validation matters.validate-track-countschecks the track dimensions for the same template.no-mismatched-template-rowsfocuses only on row-count drift.