question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

grid-area prefixing missing when multiple cells target the same grid-template-area

See original GitHub issue

This might be more of an edge-case…

Notice: #a and #b elements are targeting the same content cell which is valid in CSS grid as I understood it.

SCSS input:

.box {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 100px 1fr 50px;
    grid-template-areas: "header" "content" "footer";

    header {
        grid-area: header;
    }

    #a {
        grid-area: content;
    }

    #b {
        grid-area: content;
    }


    footer {
        grid-area: footer;
    }
}

CSS output:

Notice: -ms-grid-row and -ms-grid-column props are missing for #b.

.google-shopping.alternate-offer-lander .box {
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: 1fr;
  grid-template-columns: 1fr;
  -ms-grid-rows: 100px 1fr 50px;
  grid-template-rows: 100px 1fr 50px;
  grid-template-areas: "header" "content" "footer";
}

.google-shopping.alternate-offer-lander .box header {
  -ms-grid-row: 1;
  -ms-grid-column: 1;
  grid-area: header;
}

.google-shopping.alternate-offer-lander .box #a {
  -ms-grid-row: 2;
  -ms-grid-column: 1;
  grid-area: content;
}

.google-shopping.alternate-offer-lander .box #b {
  grid-area: content;
}

.google-shopping.alternate-offer-lander .box footer {
  -ms-grid-row: 3;
  -ms-grid-column: 1;
  grid-area: footer;
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
yepninjacommented, Jan 30, 2018

Yeap! https://github.com/postcss/autoprefixer/blob/master/lib/hacks/grid-template-areas.js#L64 Now areas are removed from the array when it is used once. It was necessary in order to throw warning with unused areas. I’ll fix it.

0reactions
aicommented, Feb 9, 2018

Released in 7.2.6.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Grid template areas - CSS: Cascading Style Sheets | MDN
This method involves placing our items using named template areas, ... In our example each of the areas spans multiple grid cells and...
Read more >
Understanding CSS Grid: Grid Template Areas
The grid-template-areas property accepts one or more strings as a value. Each string (enclosed in quotes) represents a row of your grid. You...
Read more >
Why does a grid-area name absent in grid-template-areas ...
There are four parts to this answer. The first three help explain the fourth, which covers the reason for the extra column.
Read more >
CSS Grid in IE: CSS Grid and the New Autoprefixer
Each grid element must have unique area names. Autoprefixer only prefixes grid-gap if both grid-template-areas and grid-template-columns have ...
Read more >
CSS Grid Layout Module Level 1 - W3C
7.4 Explicit Grid Shorthand: the grid-template property; 7.5 The Implicit Grid ... A grid area consists of one or more adjecent grid cells....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found