Contain level 3 adds a size() function for querying the parent size.
I understand this makes it more explicit due to multiple types of queries (i.e. its possible to query a style() in this spec). However, this might be potentially confusing for someone expecting the same experience as @media, i.e @media (min-width: 300px).
-
Would it be possible to support both syntaxes (@container (min-width: 300px) and @container size(min-width: 300px)) to reduce developer confusion and possible frustration?
-
If we introduce size() for @container, we should probably also support size() for @media.
Contain level 3 adds a
size()function for querying the parent size.I understand this makes it more explicit due to multiple types of queries (i.e. its possible to query a
style()in this spec). However, this might be potentially confusing for someone expecting the same experience as@media, i.e@media (min-width: 300px).Would it be possible to support both syntaxes (
@container (min-width: 300px)and@container size(min-width: 300px)) to reduce developer confusion and possible frustration?If we introduce
size()for@container, we should probably also supportsize()for@media.