CSS Relative Colors Are Here! Learn hsl(from) & oklch(from) in 5 Minutes

CSSnippets on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

BeginnerDesign Engineering6 min

About this video

A short CSS tutorial on relative colors, showing how hsl(from...), oklch(from...), oklab(from...) and rgb(from...) can derive lighter and darker shades, hover states and a full theme from one base color. It is aimed at people who already write some CSS.

What you’ll learn

  • Create lighter and darker shades from one base color with hsl(from...)
  • Adjust lightness, chroma and hue with calc() in relative color functions
  • Compare hsl, oklch, oklab and rgb relative color syntax