Skip to content

Tailwind CSS v4 default palette

Tailwind gray-300: #D1D5DC

In Tailwind CSS v4, gray-300 is defined as --color-gray-300: oklch(87.2% 0.01 258.338), which is #D1D5DC in hex and rgb(209, 213, 220): a very light gray with a faint blue tint. In Tailwind v3, gray-300 was #D1D5DB.

gray-300#D1D5DC

In OKLCH, gray-300 has a lightness of 87.2%, chroma 0.010 and hue 258.3°.

The value fits inside sRGB, so the hex #D1D5DC represents it without loss on any screen.

In v3, gray-300 was #D1D5DB. The v4 value is ΔE OK 0.1 away, below the point where most people can tell them apart.

Tailwind gray is a cool gray with a lighter blue tint than slate, the default neutral in many Tailwind projects.

Color codes for gray-300

Color codes for gray-300
Tailwind v4 token--color-gray-300
OKLCH (source value)oklch(87.2% 0.01 258.338)
HEX#D1D5DC
RGBrgb(209, 213, 220)
HSLhsl(218, 14%, 84%)
HWBhwb(218 82% 14%)
CMYK (naive, no ICC profile)cmyk(5%, 3%, 0%, 14%)
Decimal13,751,772
Tailwind v3 hex#D1D5DB
Utility classesbg-gray-300, text-gray-300, border-gray-300

Tailwind gray scale

Contrast and accessibility

On gray-300, black text has a contrast ratio of 14.26:1 and passes AAA at any text size; white text reaches 1.47: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 gray-30014.26:1PassPassPassPass81.4
White text on gray-3001.47:1FailFailFailFail−25.4
Gray-300 text on white1.47:1FailFailFailFail22.4
Gray-300 text on black14.26:1PassPassPassPass−80.9

Tints and shades

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

Tints (mixed with white)

  1. 5%
    #d3d7de
  2. 15%
    #d8dbe1
  3. 25%
    #dde0e5
  4. 35%
    #e1e4e8
  5. 45%
    #e6e8ec
  6. 55%
    #eaecef
  7. 65%
    #eff0f3
  8. 75%
    #f4f5f6
  9. 85%
    #f8f9fa
  10. 95%
    #fdfdfd

Shades (mixed with black)

  1. 5%
    #c7cad1
  2. 15%
    #b2b5bb
  3. 25%
    #9da0a5
  4. 35%
    #888a8f
  5. 45%
    #737579
  6. 55%
    #5e6063
  7. 65%
    #494b4d
  8. 75%
    #343537
  9. 85%
    #1f2021
  10. 95%
    #0a0b0b

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, gray-300's complementary color is #D8D4CE (close to lightgray), its analogous colors are #CED6DA and #D4D4DB, and its triadic partners are #DBD2D2 and #D2D6D0. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#d8d4ce
Analogous−30°, +30°#ced6da#d4d4db
Triadic+120°, +240°#dbd2d2#d2d6d0
Split-complementary+150°, +210°#dbd3cf#d5d5ce

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 gray-300 is close to neutral: its OKLCH chroma is only 0.010, so its temperature comes from context. The faint 218° hue gives it a slightly cool cast.

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
lightgray#d3d3d31.1
gainsboro#dcdcdc2.5
lightblue#add8e64.4

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
zinc-300#d4d4d80.6
mist-300#d0d6d80.6
neutral-300#d4d4d41.0

Code snippets

Tailwind CSS
<div class="bg-gray-300 text-black">...</div>
<p class="text-gray-300 border-gray-300">...</p>
CSS
.element {
  color: var(--color-gray-300);
  background-color: oklch(87.2% 0.01 258.338);
  border-color: #d1d5dc;
  outline-color: rgb(209 213 220);
}
SwiftUI
import SwiftUI

extension Color {
  static let gray300 = Color(red: 0.820, green: 0.835, blue: 0.863)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

const gray300 = Color(0xFFD1D5DC);
Android XML
<!-- res/values/colors.xml -->
<color name="gray_300">#D1D5DC</color>

Frequently asked questions

What is the hex code for Tailwind gray-300?
In Tailwind CSS v4, gray-300 is oklch(87.2% 0.01 258.338), which converts to #D1D5DC (rgb(209, 213, 220)) in sRGB. In Tailwind v3 the same name was #D1D5DB.
What is the difference between gray-300 in Tailwind v3 and v4?
v3 used the hex #D1D5DB; v4 redefined the palette in OKLCH as oklch(87.2% 0.01 258.338). In v3, gray-300 was #D1D5DB. The v4 value is ΔE OK 0.1 away, below the point where most people can tell them apart.
How do I use gray-300 in plain CSS?
Tailwind v4 defines every palette color as a theme variable, so in CSS you write var(--color-gray-300). By default Tailwind only emits the variables your project uses; @theme static emits all of them.
Can you use white text on gray-300?
White text on gray-300 has a contrast ratio of 1.47:1, which fails AA even for large text under WCAG 2.2. Black text reaches 14.26:1 and passes both AA and AAA. In APCA terms that is Lc −25.4 for white and Lc 81.4 for black.
Which CSS named color is closest to gray-300?
The closest is lightgray (#D3D3D3) at ΔE OK 1.1, followed by gainsboro and lightblue.

Last reviewed by Arielton Oberek.