We've Got Container Queries Now, But Are We Actually Using Them?
Briefly

If we had container queries, most of what we write as media queries today would actually be container queries. Like, on any given project, there would be more @container in the CSS than @media. I thought for sure it would be true, if not, more like 75%...
Measuring usage backs that up tenfold, but that's not fair since container queries are so relatively new, no matter how developers feel about them or use them on new projects, container queries will lag behind media queries for a very long time.
Certainly the biggest two reasons for any lag in usage are: 1. It's new. It takes time for education about features to make it out to developers. Even when you know, old habits die hard. 2. Browser support concern. The main one seems to be Safari 15, released as recently as 2022.
Even on new or actively developed projects where the developers know about them and the browser support choices enable usage (speaking from personal experience here, and it is polyfillable for the record), it still feels like container queries aren't reached for all that much.
Read at Frontendmasters
[
add
]
[
|
|
]