- From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
- Date: Fri, 13 May 2022 11:39:01 +0000
- To: public-css-archive@w3.org
This is like the `nth-value()` function discussed in https://github.com/w3c/csswg-drafts/issues/5009#issuecomment-626072319
But instead of
```css
my-button {
--size: small;
}
button {
padding: map-get((small: 4px 8px, regular: 8px 16px, large: 12px 24px), var(--size, regular));
}
```
you would use natural indices:
```css
:root {
--small: 1;
--regular: 2;
--large: 3;
}
my-button {
--size: var(--small);
}
button {
padding: nth-value(
var(--size, var(--regular));
/*small*/ 4px 8px;
/*regular*/ 8px 16px;
/*large*/ 12px 24px
);
}
```
--
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7273#issuecomment-1125967493 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 13 May 2022 11:39:02 UTC