HTML & CSS · Senior · Question 29 of 75
Why is oklch() more convenient than hsl() for design systems?
- 1It renders colors more accurately on old sRGB monitors than
hsl() - ✓Correct answer: It's perceptually uniform: equal L looks equally light across hues
- 3It's more compact, written in hexadecimal form with alpha
Explanation
In HSL, yellow and blue with the same "lightness" look completely different, so palettes must be tuned by hand. OKLCH is based on a perception model, so shade scales are generated predictably, which simplifies contrast. Tailwind v4's default palette is defined in OKLCH.