Skip to content

[css-values-4] Make mod/rem/log return a consistent type #11012

Open
@cdoublev

Description

@cdoublev

About mod(), rem(), random() (fixed in f587be0):

The argument calculations can resolve to any <number>, <dimension>, or <percentage>, but must have the same type, or else the function is invalid [...]

I think "same type" is ambiguous.

For example, with mod(1px, 1%) matching a <length-percentage>, what should it be?

The type of both argument calculations is [length → 1] but 1% also has a length percent hint. The type of mod() should be [length → 1] with a length percent hint, which corresponds to the consistent type.

The type definition of log() is slightly less ambiguous: "<number> made consistent with the input calculation's type". What is the input calculation's type?

Since argument calculations are restricted to <number>s, returning <number> made consistent with each calculation type, or the consistent type is equivalent. If prefer the latter, for consistency.

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