We can't have container queries because of “browser internals” but it's now trivial for a developer to implement them in JavaScript? 🤔 Hmmmmmmmmmm ok 😐
🔥 ResizeObserver has landed in Firefox Nightly! We're one step closer to being able to do high-performance ultra responsive design with no media queries 🥳
10
23
1
213
I thought it was because they could cause cycles?
1
2
I think JavaScript can have infinite loops too but not in my code of course 😇 🤔🤔🤔
2
6
It is because of loops. Gonna admit, it’s a bit esoteric: Inf. loops has always been possible in JS, so RO is not adding anything new here (RO also breaks up loops across frames once detected). We don’t have cyclic dependencies in CSS and we are not gonna start adding them.
3
6
I think we could build container queries on top of CSS containment (need to separate layout-width & layout-height). That is, have container queries in stylesheets on elements with the right containment . Then able to container-query the width given contain:layout-width, etc.

May 17, 2019 · 9:24 PM UTC

6
1
16
If it's going to happen it needs somebody to drive it, though. It's on my list of "would like to do" projects, but probably not soon.
1
3
Yeah, the width/height separation is key. CQs that only work with `contain:size` parents aren't very useful. Most of the time a component depends on its parent for sizing in one direction but then needs flexible sizing in the other direction.
1
2
Oh that combination I hadn’t heard before. I like it!
2
Yup, this is what I've laid out in the past. We have all the primitives needed now. Biggest blocker in making a built-in for it is accepting that the timing might not be exact; [...]
1
4
What specific containment options do you think are necessary? I would guess `size layout style` ? I'm trying to build some demos to get a sense of exactly how restrictive/weird this would be, for imagined common use cases.