Skip to content

[css-color-adjust-1] background-color in forced color modes needs more than a simple unset #4175

Closed
@melanierichards

Description

@melanierichards

In Properties Affected by Forced Colors Mode we define a set of UA stylesheet expectations for various properties, including:

background-color: revert !important;

In practice, this means most elements are unset to a transparent background color, which is not precisely the best user experience. For example, as the spec is currently written, .foo in this fiddle would have a transparent background and would be awkward to modify via UA stylesheet on top of an unset/revert.

Instead, we probably want to manage the forced background-color post computed-value resolution, such that:

  • Elements with non-transparent computed background colors are rendered with a solid system background color (e.g. .foo in the example renders with a background color of Canvas)
  • Otherwise, elements' background-color can be unset as described. The UA is then free to make further adjustments in their stylesheet, using simple selectors (e.g. selecting for <button> elements).

The spec probably needs a language update if allowing this UA logic seems reasonable.

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