[csswg-drafts] [css-values] Add `empty` or `null`-like value (for CSS Custom Properties) (#10441)

raphaelokon has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values] Add `empty` or `null`-like value (for CSS Custom Properties) ==
There was a brief conversation (I think between @kizu and @andruud) I participated during CSS Day regarding a declarative keyword to mark the guaranteed absence of a value for a custom property to avoid the `space toggle hack`, e.g.

```css
.meow {
  --foo: ; /* <- One whitespace character here. */

  color: var(--foo, hotpink) /* Resolves to `--foo` */
}
```

would become → 

```css
.meow {
  --foo: empty; /* <- Declarative absence of a value. */
  
  color: var(--foo, hotpink) /* Resolves to `hotpink` */
}
```

I think that the inline conditional or `if()` spec #10064 by @LeaVerou (which was just marked as resolved 🎉) may fix a lot of use-cases around this, but there maybe still be use-cases for a declarative empty value.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10441 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 13 June 2024 10:52:16 UTC