grid-area prefixing missing when multiple cells target the same grid-template-area
See original GitHub issueThis 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:
- Created 6 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
Released in 7.2.6.