Skip to content

[css-color] What to do if there's no valid fallback? #349

Closed
@tabatkins

Description

@tabatkins

The current spec doesn't define what color to resolve color() to when all the options cause fallback. For example, what do you get from color(nonsense-colorspace .1 .2 .3)?

I think the only two reasonable options are opaque black, or transparent black. Given that the opacity defaults to 100% if omitted, I'm leaning toward opaque black.

On the other hand, we default to "transparent" in similar cases, like image(), which represents a transparent image with no intrinsic dimensions if all the alternatives are invalid, exactly as if you'd put image("nonsense", transparent). This might be explainable by the different assumed contexts - most elements don't have background images so defaulting to invisible is fine, but most colors are used to make things visible so defaulting to an opaque color is better.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions