HTML & CSS · Senior · Question 29 of 75

Why is oklch() more convenient than hsl() for design systems?

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.

Further reading

Problem with a question

HTML & CSS · Senior · question 29

Test yourself

Take the HTML & CSS · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz