Skip to content

[css-variables] CSS-wide keywords in fallbacks #5325

@andruud

Description

@andruud

Suppose we have: div { display: var(--undefined,inherit); }

The cascaded value for display is in this example a sequence of tokens (not a CSS-wide keyword), hence the explicit defaulting behavior in the cascade is not triggered. At computed-value time, the var() substitutes to inherit. This is valid per css-values which states that the grammar of all properties are understood to also allow unset | initial | (etc). This means we end up with a valid value of inherit that we somehow have to deal with computed-value time.

It seems useful to be able to use CSS-wide keywords in the fallback, especially with revert. We should consider specifying that if a declaration ends up with a CSS-wide keyword after var() substitution, it's resolved at computed-value time similarly to how it's normally done cascade-time. (I'll just have to think about whether this triggers any of the Bad Stuff from #4155).

Or failing that, make it IACVT, but we shouldn't leave it undefined.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions