Skip to content

[css-color-4] [css-backgrounds-4] text system color conflicts with background-clip #4465

Closed
@emilio

Description

@emilio

https://drafts.csswg.org/css-backgrounds-3/#propdef-background allows you to specify a background-clip value using one of the <box> bits in the syntax..

backgrounds-4 defines background-clip: text, which multiple browsers implement and ship from a long time ago. It is my intuition that if we allow to set background-clip in the background shorthand, we should also be able to set background-clip: text.

Firefox does this already: background: linear-gradient(red, blue) text parses as background-image: linear-gradient(..); background-clip: text; background-*: initial.

The system colors introduced in css-color-4 (#4091) include a Text value, which conflicts with background-clip: text in the background shorthand.

That means that the previous example will start parsing as background-color: text rather than background-clip: text, which is a significant behavior change.

So we have multiple options I guess:

  • Make this behavior change (as I think Gecko is the only engine that supports background-clip: text on the background shorthand as of now). This would be a bit unfortunate, but probably ok?
  • Rename the text system color to something else, to prevent the naming conflict.
  • Something else I may be missing?

cc @melanierichards @dbaron

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