Approximating contrast-color() With Other CSS Features
Posté : 13 févr. 2026, 04:09
You have an element with a configurable background color, and you’d like to calculate whether the foreground text should be light or dark. Seems easy enough, especially knowing how mindful we ought to be with accessibility.
There have been a few drafts of a specification function for this functionality, most recently, contrast-color()...
En savoir plus...