Skip to content

[css-color-4] Do we actually need hwb()? #6940

Closed
@LeaVerou

Description

@LeaVerou

hwb() was added to CSS Color over 8 years ago, when we still thought sRGB-only formats and manually tweaking components to create variations were the way to go. The theory was that because its two non-hue components are whiteness and blackness, it would make it easier to create tints and shades of colors.

After going unimplemented for 8 years, it was now implemented in Gecko and WebKit alongside other things in Color 4, but its usage on the web is still 0, so there is no web compat risk in removing it.

Here’s why I think we should remove it:

  • We shouldn't be adding new sRGB-only color formats (and even though this has been in the spec for 8+ years, it's new in browsers), instead we should gently guide authors away from the existing ones.
  • Color modification is now moving in a different direction and (OK)Lab/LCH are far superior for creating variations of an existing color and color-mix() is far superior for creating tints and shades (mixes with white and black) of any existing color.
  • It's not like there's any tooling that uses HWB either so we don't need to keep it around for compat with that.
  • It would allow us to close 2 issues

So let's kill it with fire! 🔥🔥🔥 Who's with me? 😃

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.css-color-4Current Work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions