lightningcss icon indicating copy to clipboard operation
lightningcss copied to clipboard

Grid template shorthand causes unreachable code with `grid-template-areas`

Open dlebedynskyi opened this issue 1 month ago • 0 comments

Context

When using grid shorthand property together with grid-template-areas we are hitting unreachable code

Sample


.grid-broken {
    display: grid;
    /* */
    grid: auto-flow / 1fr 2fr 1fr;
    /*  This will cause an error */
    grid-template-areas: ". content .";
}

.grid-broken-working {
   display: grid;
 /* Not using shorthand syntax for grid works  without the issue */
    grid-auto-flow: row;
   
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-areas: ". content .";
}


Error seen

lightningcss/lightningcss/src/properties/grid.rs:830:16:
| internal error: entered unreachable code
| stack backtrace:

To see it live

Link to playground

dlebedynskyi avatar Dec 01 '25 19:12 dlebedynskyi