Toolman

Tailwind yellow colours

The eleven yellow shades in the default Tailwind CSS palette, with the contrast figures that decide which of them you can actually put text on.

Every yellow shade

ClassHexRGBOn whiteText colourAs text
yellow-50#FEFCE8254, 252, 2321.03:1black
yellow-100#FEF9C3254, 249, 1951.07:1black
yellow-200#FEF08A254, 240, 1381.16:1black
yellow-300#FDE047253, 224, 711.32:1black
yellow-400#FACC15250, 204, 211.53:1black
yellow-500#EAB308234, 179, 81.92:1black
yellow-600#CA8A04202, 138, 42.94:1black
yellow-700#A16207161, 98, 74.92:1whiteAA
yellow-800#854D0E133, 77, 146.85:1whiteAA
yellow-900#713F12113, 63, 188.67:1whiteAA
yellow-950#42200666, 32, 614.57:1whiteAA

"On white" is the contrast ratio against a white page. "As text" is whether that ratio passes WCAG AA for normal text, which needs 4.5:1; large text needs only 3:1.

Where the scale turns over

yellow-700 is the lightest shade that reaches 4.5:1 against white, so it is the first one usable for body text on a white page. It is also where a background of this hue stops taking black text and starts needing white — the two thresholds are 4.5:1 and 4.58:1, and on this scale they fall on the same step.

Using yellow in Tailwind

<div class="bg-yellow-500 text-black">
<p class="text-yellow-700">

The text class above is the lightest yellow that still passes AA on a white background.

Frequently asked questions

What is the hex code for Tailwind yellow-500?

#EAB308 — RGB 234, 179, 8. Full values and contrast for #EAB308.

Which Tailwind yellow shades can I use for text?

yellow-700, yellow-800, yellow-900, yellow-950 reach 4.5:1 against white and pass AA for normal text. Anything lighter fails, whatever it looks like on your monitor.

Should text on a yellow background be black or white?

Black up to yellow-600, white from yellow-700 down. The two are never both comfortable: at the crossover neither reaches 4.5:1.

All Tailwind colours · Colour reference