However, one problem mentioned here is vendor prefix grouping. I've never experienced this problem or seen a grouped prefix ignored by any browser. Autoprefixer doesn't even ungroup prefix rules. I even ran a grouped prefix through W3C validator and came away validated, though the article mentions it's not W3C compliant.
Defensive CSS
11–20 of 73 posts
Re: Defensive CSS
#12Wow this is great. I could have really used some of these examples a few days ago. CSS grid combined with media queries feels like cheating to me. Am I missing something big here, or is this all safe to use in 2022?
Re: Defensive CSS
#13Wow this is great. I could have really used some of these examples a few days ago. CSS grid combined with media queries feels like cheating to me. Am I missing something big here, or is this all safe to use in 2022?
CSS Grid + CSS Variables really take CSS to another level.
Re: Defensive CSS
#14https://dom-event-to-css-variable.glitch.me/
https://github.com/pseudosavant/dom-event-to-css-variable.js
Re: Defensive CSS
#15Most of these are pure common sense if you are apt with CSS. However, one problem mentioned here is vendor prefix grouping. I've never experienced this problem or seen a grouped prefix ignored by any browser. Autoprefixer doesn't even ungroup prefix rules. I even ran a grouped prefix through W3C validator and came away validated, though the article mentions it's not W3C compliant.
Re: Defensive CSS
#16Re: Defensive CSS
#17Re: Defensive CSS
#18Wow this is great. I could have really used some of these examples a few days ago. CSS grid combined with media queries feels like cheating to me. Am I missing something big here, or is this all safe to use in 2022?
CSS Grid has been safe for use for a few years now (if you're supporting modern browsers).
https://caniuse.com/mdn-css_properties_display_grid
The problem is that popular frameworks like Bootstrap and Bulma still don't support CSS Grid (they use flexbox only for layout).
It's ironic that developers have rightly complained how cumbersome CSS layout has been in the past. Now we have CSS Grid - and yet developers still aren't using it.