coderef

HWBBaseline · Widely available

The hwb() CSS function picks colors using hue, whiteness, and blackness channels.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Apr 28, 2022. Widely available since Oct 28, 2024.

Browser support

DesktopChrome
1–100Not supported
101+Supportedsince Apr 26, 2022
Current: 155
Edge
12–100Not supported
101+Supportedsince Apr 28, 2022
Current: 154
Firefox
1–95Not supported
96+Supportedsince Jan 11, 2022
Current: 157
Safari
1–14.1Not supported
15+Supportedsince Sep 20, 2021
Current: 27
MobileChrome Android
18–100Not supported
101+Supportedsince Apr 26, 2022
Current: 155
Firefox Android
4–95Not supported
96+Supportedsince Jan 11, 2022
Current: 157
Safari iOS
1–14.5Not supported
15+Supportedsince Sep 20, 2021
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: hwb.

Feature detection

CSS · check before using
@supports (color: hwb(200 10% 20%)) {
  /* styles that use hwb */
}

/* or in JavaScript */
if (CSS.supports("color", "hwb(200 10% 20%)")) {
  // use it
}

Documentation (MDN)

Specification

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
<color>.hwb10110196151019615
<color>.hwb.mixed_type_parameters1211211221812112218