Skip to content

[css-values-4] min/max(%, %) should explicitly evaluate against the % value, not the resolved value #4227

@tabatkins

Description

@tabatkins

When looking at an expression like min(10%, 20%), it seems reasonable at first glance to assume that it always resolves to 10%.

In most properties in CSS, %s always resolve against non-negative values, so this does indeed happen whether you're looking at the raw %s or their resolved values.

However, @dbaron points out that in bg-position, if the bg-image is larger than the bg positioning area, a % resolves to a negative value. Thus it matters which stage you're looking at for the min() and max() functions.

What should we do? Note the more complex example of min(10% + 10px, 20% + 5px); you can't make a judgement based purely by looking at the unresolved %s, but after resolution, due to the BG cases, either one could end up the smaller.

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