CIE Lab color functions for CSS
- Category
- CSS
- Type
- New or changed feature
- Status
- In development (Chrome In development)
- Intent stage
- Start prototyping
WPT details: WPT tests are lab-001 to lab-007 and lch-001 to lch-007 in: https://wpt.fyi/results/css/css-color?label=experimental&label=master&aligned
Summary
CSS Working Group has added the lch() and lab() functions to the CSS Color Module Level 4 specification. These are based on the CIE LAB color space, which is able to represent colors in a way that closely matches human perception. The purpose of this intent is to implement the functions lch() and lab() as described in the CSS spec.
Motivation
These new functions will enable design tools and design systems to handle colors with higher richness, fidelity, and flexibility, and improve accessibility. Supporting this functionality will also help unblock other color related additions to CSS.
Standards & signals
- Specification: https://www.w3.org/TR/css-color-4/#specifying-lab-lch
- Firefox: No signal
- Safari: In development
- Web developers: Positive — * Blog post explaining the motivation for the lab() and lhr() CSS functions: https://bkardell.com/blog/Unlocking-Colors.html * "The Evolution of CSS 4 Color" conference talk: https://www.w3.org/Talks/2016/css4-color-talk/ * PostCSS plugin to make this functionality available to Web developers: https://github.com/jonathantneal/postcss-lab-function
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1026287
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=css%2Fcss-color
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+CIE%20Lab%20color%20functions%20for%20CSS
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=CIE%20Lab%20color%20functions%20for%20CSS
- Baseline status: https://webstatus.dev/?q=CIE%20Lab%20color%20functions%20for%20CSS
Explainers: https://drafts.csswg.org/css-color-4/#specifying-lab-lch