Post

I haven't used #CSS container queries as much as I should be. So I looked into some interesting things you can do with them, like the container style query. Pass a custom property to it, and you can style different variations. Saves you a bunch of BEM style modifier classes.

0 reposts0 likes

If you pair this with some pseudo classes like :has() or :in() or :not() you can do some pretty interesting stuff. Things like active navigation styles for example. Pretty cool. Read more about it here 👉 dommagnifi.co/lab/containe...

dommagnifi.co@container style(): components that read parent tokensCSS container style queries let child components react to custom properties on their parent, so theme, tone, and density can come from context instead of extra modifier classes.