Conversation
|
If this can happen, then something is seriously wrong. |
|
AFAIK the “recursion problem” is a known issue of the currently proposed container queries. I posted an idea in WICG/container-queries#2 (comment) how this could be possibly solved. There are more ideas around for possible solutions, see also http://alistapart.com/article/container-queries-once-more-unto-the-breach#section4. |
|
It certainly is an issue of the currently proposed container queries, unless the spec stipulates that a container must have something that makes its size independent of its children (off the top of my head, that's either block display or explicit dimensions) or else it's ignored. That way, the container query could safely be explicit about the container. If it didn't fulfil the requirements, the styles just wouldn't apply. That said, the more I think of it, the more I like your idea of having the container query be a pseudo-class on a child, and then the browser traverses up the tree until it can find a container whose size is independent of its children. It's also not terribly hard to determine whether an element's size is influenced by its children. Is it |
I’m not sure if this repo is also meant for demos illustrating current problems with container queries. If it is, here is one :)