Post

It's both rad and annoying when you find a CSS attribute that solves a problem you've worked collective hours trying to solve for. contrast-color() is one of those. Give it one color and it resolves to either black or white, whichever has stronger contrast against that solid background. More 👇

dommagnifi.cocontrast-color(): readable text from one colorCSS contrast-color() lets the browser pick black or white text from a dynamic background color, which is perfect for badges, buttons, chips, and user-picked themes.

0 reposts0 likes

No replies yet.