Skip to content

[css-color-5] Allow use of 0 with <percentage> color components #7338

@SebastianZ

Description

@SebastianZ

In w3c/fxtf-drafts#456 it was noted that the examples in Compositing 2 were wrong. The reason for that was that CSS Color 4 doesn't allow to mix <number> and <percentage> values for color components.

This is generally ok as mixing those two types of values doesn't make sense here, though in case of 0 as value this seems unexpected. People expect 0 and 0% to be exchangable.

E.g. currently rgb(100% 0 0 / 50%) is currently invalid and needs to be written as rgb(100% 0% 0% / 50%) for this reason.

Therefore, I suggest to allow combining unitless 0 values with percentages in all color functions.
Or, they could even be allowed generally for all places that take <percentage> values.

Sebastian

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