Conversation

Graham Sutherland / Polynomial

modern CSS things I recently learned:

the light-dark() function allows you to specify a colour based on the user's light/dark mode preference without needing to use media queries.

rem instead of em rules. everything becomes relative to the root size, so you can globally scale based on display size without inconsistencies.

you can load an ICC colour profile within CSS and even specify the rendering intent of that profile, to colour manage your entire page. this is *wild* and I love it.

2
0
0

you can use oklab() to specify colours in perceptual space, which is a *huge* game changer for getting your colours consistent across devices. an oklab colour should look perceptually identical regardless of whether the display is SDR or HDR. when used in CSS gradients it generates smooth results with uniform saturation and luminosity, and no banding (within the limits of the actual display, naturally). standard CSS gradients look awful by comparison.

1
0
0

@dysfun I thought they fixed that a couple of months back, along with the hue interpolation stuff

1
0
0

@dysfun I need to check to see if it actually works but yeah, colour space blending in gradients was merged 4 months ago and is enabled in FF 127.

0
0
0

@gsuberland well. added in ie9 and buggy until ie11. but that's still over a decade ago for the latter

0
0
0

@leo @gsuberland no I think the band is from the 80’s idk if that’s ancient

0
0
0