Skip to content

[css-variables][css-syntax] Whitespace trimming and var() fallbacks #6871

@andruud

Description

@andruud

I'd like to clarify one detail regarding whitespace trimming defined by consume a declaration:

What is the computed value of --x here? --x: a var(--invalid, b );

I would interpret the current specs like this: the whitespace before a gets trimmed, but we don't remove any whitespace inside the value, so a var(--invalid, b ) (with no space in front) becomes the "parsed" value. Then, substitution-time, the var() reference resolves to its fallback _b_ (using _ for space), and the post-substitution value becomes a__b_. At this point it may make sense to behave as if relevant parts of "consume a declaration" had been invoked on the final post-substitution token sequence, trimming the result to a__b, although it's not really clear if this is expected.

OR, do we trim the spaces around the <declaration-value> of the fallback at some point instead (for example, "anything we substitute in gets trimmed first")? In that case, the computed value would be a_b.

@tabatkins @emilio

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions