-
Notifications
You must be signed in to change notification settings - Fork 757
Open
Labels
Description
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.
.meow {
--foo: ; /* <- One whitespace character here. */
color: var(--foo, hotpink) /* Resolves to `--foo` */
}would become →
.meow {
--foo: valid-empty; /* <- Explicitly mark missing value as valid. */
color: var(--foo, hotpink) /* Resolves to `--foo` */
}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.
EDIT: Change the semantic of the keyword and make it less generic by naming it valid-empty re comment.
timotte, fuhlig and yairEO