You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm reviewing Container Queries and it seems like a compelling feature! Granted this is my first time trying out CSS @container in general so I might misunderstand the feature in general.
I declared by containers and containerSizes just as the documentation suggests in my theme definition.
I'm expecting the element to be flexed with flexDirection: 'row' and when it becomes small it should change direction to column. However, because the outputted CSS is using min-width my container query is never triggered. Since the element always has a min width of > 40rem (unless I really shrink it down).
@container content (min-width:40rem)
I can workaround this by reversing the logic, but something about that feels wrong (could be my misunderstanding of container queries!). To me, the base should be the style applied in all cases and only when the min-width is less than the container's size should the container query be applied.
Is this how container queries work or perhaps a design decision made by the panda team? The Responsive design options felt more intuitive to use. Container queries somehow feel a bit backward?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm reviewing Container Queries and it seems like a compelling feature! Granted this is my first time trying out CSS @container in general so I might misunderstand the feature in general.
I declared by
containers
andcontainerSizes
just as the documentation suggests in my theme definition.I then used the container query in a recipe:
I'm expecting the element to be flexed with
flexDirection: 'row'
and when it becomes small it should changedirection
tocolumn
. However, because the outputted CSS is usingmin-width
my container query is never triggered. Since the element always has a min width of > 40rem (unless I really shrink it down).I can workaround this by reversing the logic, but something about that feels wrong (could be my misunderstanding of container queries!). To me, the
base
should be the style applied in all cases and only when the min-width is less than the container's size should the container query be applied.Is this how container queries work or perhaps a design decision made by the panda team? The Responsive design options felt more intuitive to use. Container queries somehow feel a bit backward?
Beta Was this translation helpful? Give feedback.
All reactions