W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2020

Re: [csswg-drafts] [css-variables?] Higher level custom properties that control multiple declarations (#5624)

From: Emilio Cobos Álvarez via GitHub <sysbot+gh@w3.org>
Date: Tue, 01 Dec 2020 21:34:36 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-736834761-1606858474-sysbot+gh@w3.org>
I agree with @andruud fwiw. I don't understand why something like this:

> There are discussions in the group about inline conditionals [#4731, #5009]. If we were to have such conditionals, these would be possible to implement, but very painful (each declaration value would need to be one or more if()). I was wondering if we could simplify this.

Is really more painful / complex than what's being proposed here.

Basically, something like `border-radius: if(var(--pill), 0px, 999px);` seems simpler and much less action-at-a-distance to me.

In fact if you make `--pill` a boolean variable with values `0` or `1`, you can already accomplish this particular usecase (`border-radius: calc(var(--pill) * 999px)`), though I understand there are more complex use cases that aren't probably covered by such a thing (and also it is a bit more obscure than some more explicit syntax).

GitHub Notification of comment by emilio
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5624#issuecomment-736834761 using your GitHub account

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 1 December 2020 21:34:37 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:23 UTC