CSS color fallbacks
I'm confused by what the 'final' color would be in this instance:
source
My understanding is the
lab()
will in over the display-p3
since it is last?
I think the p3 should be last, or behind a media query.
Any best practices?Lightning CSS
An extremely fast CSS parser, transformer, bundler, and minifier.
3 Replies
it will apply top to bottom like any CSS property, overwriting any previous definitions but only for properties it supports. So if all three are supported, you'll end up with the
lab
definition, otherwise if that is supported, the color
definition, and finally a fallback to the hex colorthanks!
I was thinking that P3 > OKLAB, due to the wider color gambut, or does OKLAB dip into P3/REC2000 if you let it?
no idea tbh, but the order if it being applied has nothing to do with the type of color space you're using, only with the order of the arguments