3 ms·
yah, 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
by clairity 4y ago
yah, 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.