Skip to content

Tailwind CSS v4 default palette

Tailwind yellow-300: #FFDF20

In Tailwind CSS v4, yellow-300 is defined as --color-yellow-300: oklch(90.5% 0.182 98.111), which is #FFDF20 in hex and rgb(255, 223, 32): a very light, vivid amber. In Tailwind v3, yellow-300 was #FDE047.

yellow-300#FFDF20

In OKLCH, yellow-300 has a lightness of 90.5%, chroma 0.182 and hue 98.1°.

This OKLCH value lies outside sRGB. The hex #FFDF20 is the sRGB fallback from the CSS Color 4 gamut mapping algorithm; on Display P3 screens browsers show a more saturated color, close to color(display-p3 0.9827 0.8809 0.321).

In v3, yellow-300 was #FDE047. The v4 value is ΔE OK 1.6 away, below the point where most people can tell them apart; v4 is more saturated.

Tailwind yellow has very high lightness through 400, so only the 700 and darker shades are suitable for text on white.

Color codes for yellow-300

Color codes for yellow-300
Tailwind v4 token--color-yellow-300
OKLCH (source value)oklch(90.5% 0.182 98.111)
HEX#FFDF20
RGBrgb(255, 223, 32)
HSLhsl(51, 100%, 56%)
HWBhwb(51 13% 0%)
CMYK (naive, no ICC profile)cmyk(0%, 13%, 87%, 0%)
Decimal16,768,800
Display P3color(display-p3 0.9827 0.8809 0.321)
Tailwind v3 hex#FDE047
Utility classesbg-yellow-300, text-yellow-300, border-yellow-300

Tailwind yellow scale

Contrast and accessibility

On yellow-300, black text has a contrast ratio of 15.82:1 and passes AAA at any text size; white text reaches 1.32:1.

WCAG 2.2 contrast ratios (success criteria 1.4.3 and 1.4.6: AA needs 4.5:1 for normal text and 3:1 for large text, AAA needs 7:1 and 4.5:1). APCA Lc is the lightness contrast from the APCA-W3 0.0.98G model proposed for WCAG 3; a higher absolute value is more readable, and Lc 75 is its suggested minimum for body text.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on yellow-30015.82:1PassPassPassPass87.7
White text on yellow-3001.32:1FailFailFailFail−18.3
Yellow-300 text on white1.32:1FailFailFailFail15.9
Yellow-300 text on black15.82:1PassPassPassPass−87.8

Tints and shades

Each step mixes var(--color-yellow-300) with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, var(--color-yellow-300), white 25%) in CSS.

Tints (mixed with white)

  1. 5%
    #ffe12b
  2. 15%
    #ffe441
  3. 25%
    #ffe758
  4. 35%
    #ffea6e
  5. 45%
    #ffed84
  6. 55%
    #fff19b
  7. 65%
    #fff4b1
  8. 75%
    #fff7c7
  9. 85%
    #fffade
  10. 95%
    #fffdf4

Shades (mixed with black)

  1. 5%
    #f2d41e
  2. 15%
    #d9be1b
  3. 25%
    #bfa718
  4. 35%
    #a69115
  5. 45%
    #8c7b12
  6. 55%
    #73640e
  7. 65%
    #594e0b
  8. 75%
    #403808
  9. 85%
    #262105
  10. 95%
    #0d0b02

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, yellow-300's complementary color is #D5DCFF (close to lavender), its analogous colors are #FFD496 and #BCF667, and its triadic partners are #8BF1FF and #FFC6F7. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#d5dcff
Analogous−30°, +30°#ffd496#bcf667
Triadic+120°, +240°#8bf1ff#ffc6f7
Split-complementary+150°, +210°#bbe5ff#f0d1ff

Computed in OKLCH: the hue is rotated by 180° (complementary), ±30° (analogous), ±120° (triadic) and 180° ±30° (split-complementary) while lightness and chroma stay fixed. Results that fall outside sRGB are brought back with the CSS Color 4 gamut mapping algorithm. Because this uses OKLCH, the values differ from tools that rotate hue in HSL, but every color keeps the same perceived lightness.

Warm or cool?

Tailwind yellow-300 is a warm color: its hue is 51° on the HSL wheel, in the red, orange and yellow range (0° to about 70°, plus reds above 330°) that is conventionally called warm.

Nearest named and Tailwind colors

Distance is ΔE OK, the Euclidean distance in OKLab multiplied by 100. Values under about 2 are hard to tell apart side by side.

Nearest CSS named colors

Nearest CSS named colors
ColorHEXΔE OK
gold#ffd7002.0
khaki#f0e68c7.2
yellow#ffff008.0

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
amber-300#ffd2303.5
yellow-400#fcc8005.9
amber-200#fee6856.5

Code snippets

Tailwind CSS
<div class="bg-yellow-300 text-black">...</div>
<p class="text-yellow-300 border-yellow-300">...</p>
CSS
.element {
  color: var(--color-yellow-300);
  background-color: oklch(90.5% 0.182 98.111);
  border-color: #ffdf20;
  outline-color: rgb(255 223 32);
}
SwiftUI
import SwiftUI

extension Color {
  static let yellow300 = Color(red: 1.000, green: 0.875, blue: 0.125)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

val Yellow300 = Color(0xFFFFDF20)
Flutter
import 'package:flutter/material.dart';

const yellow300 = Color(0xFFFFDF20);
Android XML
<!-- res/values/colors.xml -->
<color name="yellow_300">#FFDF20</color>

Frequently asked questions

What is the hex code for Tailwind yellow-300?
In Tailwind CSS v4, yellow-300 is oklch(90.5% 0.182 98.111), which converts to #FFDF20 (rgb(255, 223, 32)) in sRGB after gamut mapping, because the OKLCH value is outside sRGB. In Tailwind v3 the same name was #FDE047.
What is the difference between yellow-300 in Tailwind v3 and v4?
v3 used the hex #FDE047; v4 redefined the palette in OKLCH as oklch(90.5% 0.182 98.111). In v3, yellow-300 was #FDE047. The v4 value is ΔE OK 1.6 away, below the point where most people can tell them apart; v4 is more saturated.
How do I use yellow-300 in plain CSS?
Tailwind v4 defines every palette color as a theme variable, so in CSS you write var(--color-yellow-300). By default Tailwind only emits the variables your project uses; @theme static emits all of them.
Can you use white text on yellow-300?
White text on yellow-300 has a contrast ratio of 1.32:1, which fails AA even for large text under WCAG 2.2. Black text reaches 15.82:1 and passes both AA and AAA. In APCA terms that is Lc −18.3 for white and Lc 87.7 for black.
Which CSS named color is closest to yellow-300?
The closest is gold (#FFD700) at ΔE OK 2.0, followed by khaki and yellow.

Last reviewed by Arielton Oberek.