TLDR · PROGRAMMING, DESIGN & DATA SCIENCE

HOW TO HAVE THE BROWSER PICK A CONTRASTING COLOR IN CSS

webkit.org17 min read

Summary from the TLDR newsletter

CSS' contrast-color() allows the browser to automatically assign contrasting color values. This can be handy, especially in large projects, as managing such small details can be a really hard task to get right. Developers just need to define one color. This post provides a guide on how to use contrast-color() and discusses accessibility considerations when using the function.