Support for Nested Container Queries and the CSS if() function inside CSS Custom Functions make @function very powerful.
A rather geeky/technical weblog, est. 2001, by Bramus
@function + CSS if() = 🤯sm|md|etc) into Useful Values (aka Style Queries without Style Queries thanks to @property)
My favorite use case for Style Queries is the ability to change a bunch of styles based on the value of a so called “higher-order variable”. You use that variable as a switch to change a bunch of properties. @container style(–theme: dark) { .card { background: royalblue; border-color: navy; color: white; } .card button { …