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.
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
| Tailwind v4 token | --color-gray-300 |
|---|---|
| OKLCH (source value) | oklch(87.2% 0.01 258.338) |
| HEX | #D1D5DC |
| RGB | rgb(209, 213, 220) |
| HSL | hsl(218, 14%, 84%) |
| HWB | hwb(218 82% 14%) |
| CMYK (naive, no ICC profile) | cmyk(5%, 3%, 0%, 14%) |
| Decimal | 13,751,772 |
| Tailwind v3 hex | #D1D5DB |
| Utility classes | bg-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.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on gray-300 | 14.26:1 | Pass | Pass | Pass | Pass | 81.4 |
| White text on gray-300 | 1.47:1 | Fail | Fail | Fail | Fail | −25.4 |
| Gray-300 text on white | 1.47:1 | Fail | Fail | Fail | Fail | 22.4 |
| Gray-300 text on black | 14.26:1 | Pass | Pass | Pass | Pass | −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)
- 5%
#d3d7de - 15%
#d8dbe1 - 25%
#dde0e5 - 35%
#e1e4e8 - 45%
#e6e8ec - 55%
#eaecef - 65%
#eff0f3 - 75%
#f4f5f6 - 85%
#f8f9fa - 95%
#fdfdfd
Shades (mixed with black)
- 5%
#c7cad1 - 15%
#b2b5bb - 25%
#9da0a5 - 35%
#888a8f - 45%
#737579 - 55%
#5e6063 - 65%
#494b4d - 75%
#343537 - 85%
#1f2021 - 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.
| Harmony | Rotation | Color |
|---|---|---|
| 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.
Code snippets
<div class="bg-gray-300 text-black">...</div>
<p class="text-gray-300 border-gray-300">...</p>.element {
color: var(--color-gray-300);
background-color: oklch(87.2% 0.01 258.338);
border-color: #d1d5dc;
outline-color: rgb(209 213 220);
}import SwiftUI
extension Color {
static let gray300 = Color(red: 0.820, green: 0.835, blue: 0.863)
}import androidx.compose.ui.graphics.Color
val Gray300 = Color(0xFFD1D5DC)import 'package:flutter/material.dart';
const gray300 = Color(0xFFD1D5DC);<!-- 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.