A short CSS tutorial on the relative colour syntax in hsl(from ...), which derives a colour palette and transparent overlays from one custom property. It shows how this can reduce helper variables and simplify light and dark theming.
What you’ll learn
✓Write hsl(from var(--base-color) h s l / alpha) to derive colours from one custom property
✓Replace helper variables such as --accent-dark with colours calculated from a single base
✓Adjust alpha and lightness to build overlays and dark mode from one base colour