relative color syntax doesn't work with light-dark()?
My color palette is defined using
light-dark()
, e.g.
If I use relative color syntax, e.g.
…it doesn't set it. If I declare --bg-1
to be something fixed like #f1f1f1
then it works.
I tried in the latest versions of chrome and firefox.
Am I doing it wrong?4 Replies
I don't think the relative color syntax does accept a function as a value. i know that the light-dark-function returns a color, but don't know if it sees it like that
The other way around it will work ofcourse (but that might not suit your setup)
if it is all about the opacity, you could also do it with color-mix (that does accept the light-dark function)
as this does work, maybe it's something they forgot (or is a bug) in the relative color syntax (or is too complex to implement)
@jcayzac I asked around, it's a known bug
@MarkBoots thanks! that workaround is a life saver!
no problem, you're welcome