contrast-color() in CSS

Summary

Let the browser choose a contrasting text color with contrast-color() instead of hard-coding the pair.

For now it returns only black or white, chosen with the WCAG 2 formula, so treat it as a safety net.

Back to the library