3 ms·
Mixins could be done, but I believe we'd need some sort of lexically-scoped reference first, so that we're not trying to apply mixins that can dynamically based
by spankalee 4y ago
Mixins could be done, but I believe we'd need some sort of lexically-scoped reference first, so that we're not trying to apply mixins that can dynamically based on style resolution, which is what sunk @apply. See https://github.com/w3c/csswg-drafts/issues/3714 https://github.com/w3c/csswg-drafts/issues/3714
- clairity 4y agoyah, i've read that thread before, as well as tab atkins' "abandoning @apply" post, and i think both are trying to solve problems that are beyond css itself (js-style scoping in the first, and shadow dom styling in the latter). what i'm imagining is something more like this very contrived example: :root { --thick: 4px; --border-color: black; } $standard-border { border: 2px solid var(--border-color); /* not evaluated here */ } div { @apply $standard-border; /* evaluated here */ } /* somewhere else, perhaps a different file */ .bordered { --border-color: grey; @apply $standard-border; /* evaluated here */ border-width: var(--thick); /* an override */ } here, the string would simply be substituted into place and then evaluated as if the substitution had been written there all along. this seems like it would avoid the multiple evaluation and circularity issues that have sunken prior proposals.