I've been exploring relative color syntax, and this was a bit of a surprise.
Unlike with color mix, you can't use a color defined with light-dark() as an input and expect to have a good time.
CodePen example: https://codepen.io/adamstoddard/pen/eYwwNbM
=> More informations about this toot | More toots from aaadaaam@mastodon.social
@aaadaaam I'm seeing two different issues:
In all browsers, you have to remove the deg
units from the hue calculation. The h
returns a number (no unit), and it seems numbers and lengths aren't compatible for +/- operations in general. This isn't specific to relative colors.
In Safari 18TP (the only browser with full RCS support), light-dark() works fine at that point. I expect light-dark() has similar difficulties to currentColor.
=> More informations about this toot | More toots from mia@front-end.social
@mia appreciate the detailed response, that's super helpful.
In retrospect, perhaps not the best idea to test in every browser except the one with full RCS support 🫠
=> More informations about this toot | More toots from aaadaaam@mastodon.social
@aaadaaam Thanks for the nerd snipe. I didn't know any of this (including which browsers to check) before seeing your post and wondering if it was a bug or a spec limitation.
=> More informations about this toot | More toots from mia@front-end.social This content has been proxied by September (ba2dc).Proxy Information
text/gemini