Angelika Tyborska on Nostr: I got excited at the idea of calc/clamping color lightness in hsl() only to discover ...
I got excited at the idea of calc/clamping color lightness in hsl() only to discover that there is no way to do it that will work in all browsers 😢.
Adding percentages works in Safari, doesn't work in FF and Chrome:
background-color: hsl(from #ff00ff h s calc(l + 30%))
Adding numbers works in FF and Chrome, doesn't work in Safari:
background-color: hsl(from #ff00ff h s calc(l + 30))
Here's a code pen: https://codepen.io/angelikatyborska/pen/MYgwJyv
Please somebody tell me that I'm wrong?
#CSS #WebDev
Adding percentages works in Safari, doesn't work in FF and Chrome:
background-color: hsl(from #ff00ff h s calc(l + 30%))
Adding numbers works in FF and Chrome, doesn't work in Safari:
background-color: hsl(from #ff00ff h s calc(l + 30))
Here's a code pen: https://codepen.io/angelikatyborska/pen/MYgwJyv
Please somebody tell me that I'm wrong?
#CSS #WebDev