Skip to content

[css-color-4] rgba() is legacy so does not support none. Right? #7900

@svgeesus

Description

@svgeesus

From CSS Color 4:

The rgb() function defines an sRGB color by specifying the red, green, and blue channels directly

For legacy reasons, rgb() also supports a legacy color syntax that separates all of its arguments with commas:

Also, an rgba() legacy color syntax also exists, with an identical grammar and behavior to rgb().

Now I guess there are two ways of reading this:

a) rgba() is a legacy only syntax, so rgba(18% none 56% / 30%) is invalid
b) rgba() has a modern syntax, which is not described explicitly but is "identical" except for using rgba, and a legacy syntax given below.

@tabatkins Which is it?

I had assumed a). But WPT tests like parsing/color-computed-rgb.html seem to assume b). WPT results as do Chrome and Safari.

Either way the spec needs to clarify.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions