Skip to content

[css-properties-values-api] Computed value substitution #792

@andruud

Description

@andruud

The spec does currently not describe any change to the var() substitution behavior. Hence I have been operating under the assumption that it works like in css-variables, except that instead of always substituting the specified value, you substitute a "synthetic" token stream equivalent to the computed value described in 2.4.

However, after reading issue #321, I think the spec definitely needs to deal with this explicitly.

<!-- --x is registered as <length> (inherited) -->
<div style="font-size: 10px; --x: 2em;">
  <div style="font-size: 1px; height: var(--x);" id=inner></div>
</div>

What is the computed value of height on #inner in the example above? If we follow the current spec without reading between the lines, it's 2px. Probably, what we want is 20px. In any case, the spec should mention the correct behavior.

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