Re: [csswg-drafts] [css-color-5] Allow use of 0 with <percentage> color components (#7338)

Thank you for helping out, @rviscomi!

> > But maybe someone could make an HTTP archive query to check whether there are currently usages of number and percentage mixtures (that currently break but would work after that change and cause a visual difference).
> 
> Happy to give this a go.
> 
> Could you clarify which color functions you're interested in? Here's the list I was planning to use:
> 
>     * rgb
>     * rgba
>     * hsl
>     * hsla
>     * color

`color()` already allows to mix `<number>`s and `<percentage>`s as well as all the other new color functions like `lch()`, `lab()`, etc. So this is just about the four old color functions `rgb()`, `rgba()`, `hsl()` and `hsla()` and maybe also the new `hwb()`. The syntaxes of the last three already got changed in CSS Color 5 to allow mixing numbers and percentages.
The four old color functions need to be checked using their old comma-separated syntaxes (e.g. `rgb(0, 0, 100%)`, `rgb(0, 0, 100%, 90%)` and `hsla(0, 0, 100%, 0.9)`) and their new space- plus optional slash-separated syntaxes (e.g. `rgb(0 0 100%)`, `rgb(0 0 100% / 90%)` and `hsl(0 0.4 60% / 0.9)`). Also note that `rgb()` is syntactically identical to `rgba()` since CSS Color 4, and `hsl()` to `hsla()`.
So all variants should be checked.

> Could you also clarify whether it's valid to have number values for everything but the alpha? Is this valid: `rgba(0,0,0,5%)`?

That's already valid and implemented in browsers today. So no need to check that. But what needs to be checked are the variants above in combination with `<number>` and `<percentage>` alpha values.

Sebastian


-- 
GitHub Notification of comment by SebastianZ
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7338#issuecomment-1179601506 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 9 July 2022 20:23:42 UTC