Color in CSS: using new spaces, functions, and techniques to make your site shine
summary
CSS adds new color spaces and functions that let sites access wider gamuts and perceptually uniform mixes: display-p3 color() with >1 channel values shows noticeably brighter blues versus sRGB in the demo, and oklch fixes blue hue shift removes the purple artifact seen in lab gradients. New APIs include color-mix, relative color syntax to adjust H/S/L without separate custom props, and accessibility helpers like light-dark supported in Firefox while color-mix inconsistent across browsers (and color-contrast remains experimental in Safari).
AI-written summary · about
chapters (13)
- 0:00Introduction and speaker background
- 1:04Overview of current color spaces
- 3:51Understanding gamuts and color spaces
- 8:53New features in CSS Color Module 4
- 10:17CIE and Display P3 color spaces
- 17:45LAB, LCH, and OKLAB/OKLCH color spaces
- 24:28CSS Color Module 5 features
- 25:31Color mix function demonstration
- 30:47Relative color syntax
- 33:15Light dark function for accessibility
- 35:45Color contrast function preview
- 37:10Summary and additional resources
- 38:14Q&A session
