[css-grid] Report a warning if duplicate area names are detected
See original GitHub issueTake this css:
.grid-alpha {
grid-template-areas: "delta echo";
}
.grid-beta {
grid-template-areas: "echo delta";
}
.grid-cell {
-ms-grid-column: ???; /* what column does .grid-cell go in? */
arid-area: echo;
}
Autoprefixer has no access to the DOM so it doesn’t really know what area .grid-cell
belongs to.
Currently Autoprefixer silently just goes with whatever the last grid-template-areas
definition was in the style-sheet (in this case "echo delta"
). If a user places .grid-cell
in .grid-alpha
then it will look great in modern browsers but be placed in the wrong column in IE.
Since it is silent, a user could end up building their whole site blissfully unaware of this issue, using duplicate area names everywhere, then finally open IE to see their whole layout go to shit.
Autoprefixer should detect if there are any area name conflicts and if so, warn users to use unique area names at all times.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:15 (10 by maintainers)
Top Results From Across the Web
CSS Grid in IE: Duplicate area names now supported!
In Part 2 of the series, I pointed out why Autoprefixer wasn't able to handle duplicate area names that were used across multiple...
Read more >netbeans 8.2 css grid warnings and errors - Stack Overflow
This question is closely related to another on SO, but it is not a duplicate: Netbeans CSS not hinting all properties.
Read more >CSS Grid Layout and progressive enhancement
In this guide we will walk through a variety of strategies for support. The supporting browsers. Other than in Internet Explorer, CSS Grid...
Read more >ANDI - Alerts
When ANDI is launched, it automatically analyzes every HTML element currently on the page looking for conditions that cause accessibility issues.
Read more >redcap-faq.pdf - UT Southwestern
If the project combines a survey and data entry forms, the survey must be the first instrument so that new records are initiated...
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
@ai I’ve removed the references to this issue in the CSS Tricks article since it has been fixed now.
Forgive me if I’m missing something but isn’t this:
the way you’re supposed to describe a grid with what amounts to rowSpan and colSpan sections? Something like…
Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas
Are you saying that while it’s legal, it isn’t supported by IE? It seems like a problem that legal CSS generates a warning. Is there a better way to accomplish the layout and still get autoprefixer support?