Skip to content

[css-values-4] Specify how to determine the type of a standalone <dimension> #11765

Open
@cdoublev

Description

@cdoublev

A feature dimension value specified with a math function matches <dimension> in <mf-value>:

<mf-value> = <number> | <dimension> | <ident> | <ratio>

According to CSS V&U, a math function can only resolve to a subset of <dimension>:

A math function resolves to <number>, <length>, <angle>, <time>, <frequency>, <resolution>, <flex>, or <percentage> according to which of those productions its type matches.

So implementations should either expand <dimension> to this restricted set when it is produced by <mf-value>, or they should skip type checking a math function matching <mf-value>, since <mf-value> must be validated against the grammar of the specified feature value anyway.

This can be clarified or, <calc-sum> could be produced instead of <number> | <dimension> | <ratio>, which would be on par with *-progress(<mf-name>, <calc-sum>, <calc-sum>), which requires validating <calc-sum> according to the grammar of the specified <mf-name> (or only its numeric type? #10802).

This would mean that queries like @media (10vw + 1rem < width) {} or @media ((10vw + 1rem) < width) {} would work.

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