parcel-bundler / lightningcss

An extremely fast CSS parser, transformer, bundler, and minifier written in Rust.
https://lightningcss.dev
Mozilla Public License 2.0
6.29k stars 176 forks source link

transcribes OKLCH poorly #730

Closed tomByrer closed 3 months ago

tomByrer commented 4 months ago

For some reason the playground translates OKLCH into LAB, which is undesired. I believe it is best to keep input OKLCH colors, when the only difference between OKLCH & [LAB]() is Safari 15.0-15.3 & Opera 97 AFAIK.

The hex colors are fine, though might be redundant in the browser compatible I selected? If the point of hex colors is to prevent from entering P3/REC2000 color spaces, then the OKLCH/LAB CSS should be inside a P3/REC2000 @supports selector.

Seems CIELAB is a step back from OKLCH: https://bottosson.github.io/posts/oklab/ https://evilmartians.com/chronicles/oklch-in-css-why-quit-rgb-hsl#oklch-vs-lch

demo

devongovett commented 4 months ago

That's because you've forced the Colors feature to on, which overrides the browser compatibility data we use by default. With default settings, this does not occur. Example