- From: Lea Verou via GitHub <sysbot+gh@w3.org>
- Date: Wed, 15 Feb 2023 15:22:42 +0000
- To: public-css-archive@w3.org
Actually, I just remembered that I had defined `if()` with the second parameter optional, and it defaults to an empty value. This means you can do it like this:
```css
my-button {
--size: small;
}
button {
--size-index: if(--size: small, 1) if(--size: regular, 2) if(--size: large, 3);
padding: nth-value(--size-index, ...);
}
```
(I should also change the syntax to use `;` for a separator, so the values can contain commas)
--
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7273#issuecomment-1431541098 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 15 February 2023 15:22:43 UTC