Post #961688
2026-03-04 14:27 UTC
Soon across all browsers: CSS contrast-color()!
It returns a color that has guaranteed contrast against an other color.
Very useful for computing text color with enough contrast against an unknown background.
Demo ➡️ https://codepen.io/captainbrosset/pen/jEMWepJ?editors=1100
Docs ➡️ https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/color_value/contrast-color
Replies (0)
No replies.