HSLBaseline · Widely available
The hsl() and hsla() CSS functions pick colors using hue, saturation, lightness, and alpha (transparency) channels.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 15, 2020. Widely available since Jul 15, 2022.
Browser support
DesktopChrome
1–64Not supported
65+Supportedsince Mar 6, 2018
Current: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
1–51Not supported
52+Supportedsince Mar 7, 2017
Current: 157Safari
1–12Not supported
12.1+Supportedsince Mar 25, 2019
Current: 27MobileChrome Android
18–64Not supported
65+Supportedsince Mar 6, 2018
Current: 155Firefox Android
4–51Not supported
52+Supportedsince Mar 7, 2017
Current: 157Safari iOS
1–12Not supported
12.2+Supportedsince Mar 25, 2019
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: hsl.
Feature detection
CSS · check before using
@supports (color: color(display-p3 1 0 0)) {
/* styles that use hsl */
}
/* or in JavaScript */
if (CSS.supports("color", "color(display-p3 1 0 0)")) {
// use it
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (4). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| <color>.hsl | 1 | 12 | 1 | 3.1 | 18 | 4 | 2 |
| <color>.hsl.alpha_parameter | 65 | 79 | 52 | 12.1 | 65 | 52 | 12.2 |
| <color>.hsl.mixed_type_parameters | 121 | 121 | 122 | 18 | 121 | 122 | 18 |
| <color>.hsl.space_separated_parameters | 65 | 79 | 52 | 12.1 | 65 | 52 | 12.2 |