Chip Cullen describes a situation familiar to front-end developers: a designer hands over a polished design, the body copy looks fine, but the inline links in that copy have no underlines. For a developer who cares about accessibility, that missing underline raises a question with no easy answer — which Cullen calls The Contrast Triangle.

The "triangle" refers to a three-way comparison that has to hold up:

  • the contrast between the background and text,
  • the contrast between the background and links, and
  • the contrast between text and links.

The CSS-Tricks write-up grants that the issue exists even when links are underlined, though it accepts Cullen's point that the problem gets worse once the underline is gone.

The piece goes on to argue that the problem is in fact more complicated than three sides. Selected text has to be considered as well, so that everything keeps its contrast while highlighted. The same goes for hover, active, visited and focus states — which, the author jokes, makes it more like a hexacontakaienneagon of contrast.

Direct Link →

CSS-Tricks star logo

Sponsor CSS-Tricks!

We've got lots of ways to help you connect with the greatest front-end community in all the land.

CSS-Tricks Newsletter

Sign up to get front-end roundups, browser updates, and exclusive content sent to your inbox bi-weekly.

Ads are self-hosted