Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
natemwilson
· 1y ago · 0 comments
I’ve never seen any CSS function that has this call back style where you get parameters that you can modify. So interesting! Are there any other examples of this or is this unique to lch?
Comments
[–]
fireflies_
1y ago
This is "relative color" syntax, it works with a range of color spaces/color functions. The key is the "from" at the front. Here's the MDN documentation:
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_colors/...
[–]
halflife
1y ago
It may be confusing, but everything here is static param. The —- prefix is css variables, where inside a css declaration block you write: —bg: blue
[–]
natemwilson
OP
1y ago
The `l` isn't!
[–]
KTibow
1y ago
Some newer ones like calc-size are also like this.