I'm bullish on CSS mixins

As a component library developer, @mixin from the Functions and Mixins Module has quickly become one of my favorite parts of CSS. Even though I have to polyfill it, mixins solve so many of the problems with classes+variables:

Mixins could kill or reform CSS Modules

CSS ModulesPure CSS
@valueCSS variables
Composition@apply
from@import
Defining a classDefining a mixin

However: my polyfill can't transform dynamic access like size="--m3-button-large" color="--m3-primary", and even once mixins are widely supported, the ecosystem won't be able to tree shake dynamic access. We need a .mixin.css or something that you can import just what you need from, so unused mixins can be eliminated - or more generically, we need support for granular imports from a CSS file.

We would also need syntax. For example, Svelte would need something like style|apply={[size, color]}.