csstools / csstools/postcss-advanced-variables
Can't use variables for custom property names in @each loops
Open
- Dominant language
- JavaScript
- Stars
- 144
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to set up an each loop to render a list of layers as custom properties that we'll use for z-index values in our pattern library. However, I can't find a way to get the layer variable to render as a custom property name.
Here's a test case:
```css
$layers: alpha, beta, gamma, delta;
:root {
@each $layer $i in $layers {
--#{$layer}: $i;
}
}
.beta {
z-index: var(--beta);
}
```
Contributor guide
Assessment
This issue has not been assessed yet.