Skip to main content

bg-gray-300

Tailwind Gray 300

#D1D5DB·Gray family·Shade 300

Color Values

HEX
#D1D5DB
RGB
rgb(209, 213, 219)
HSL
hsl(216, 12%, 84%)
OKLCH
oklch(0.872 0.009 258)
CMYK
cmyk(5%, 3%, 0%, 14%)
CSS Variable
var(--color-gray-300)
Tailwind Class
bg-gray-300

Accessibility Score

60/100

Good

Based on WCAG 2.1 contrast ratios against white and black backgrounds.

On White

1.47:1

Fail

On Black

14.25:1

AAA
Test in Contrast Checker →

Tailwind Usage — All Utilities

Background

bg-gray-300

Text

text-gray-300

Border

border-gray-300

Ring

ring-gray-300

Outline

outline-gray-300

Fill

fill-gray-300

Stroke

stroke-gray-300

From (gradient)

from-gray-300

Via (gradient)

via-gray-300

To (gradient)

to-gray-300

Placeholder

placeholder-gray-300

Caret

caret-gray-300

Accent

accent-gray-300

Decoration

decoration-gray-300

Shadow Color

shadow-gray-300

Tailwind v3 Config (extend custom color)

// tailwind.config.js module.exports = { theme: { extend: { colors: { 'gray-300': '#d1d5db', }, }, }, };

CSS Equivalent

/* Hex */
background-color: #D1D5DB;

/* RGB */
background-color: rgb(209, 213, 219);

/* HSL */
background-color: hsl(216, 12%, 84%);

/* OKLCH (CSS Color Level 4) */
background-color: oklch(0.872 0.009 258);

/* CSS Custom Property (Tailwind v4) */
background-color: var(--color-gray-300);

/* Gradient example */
background: linear-gradient(135deg, #f9fafb 0%, #9ca3af 100%);

OKLCH — Modern Color Space

Lightness (L)

0.872

87% perceived brightness

Chroma (C)

0.009

Color intensity / saturation

Hue (H)

258°

Angle on perceptual hue wheel

oklch(0.872 0.009 258)

OKLCH is a perceptually uniform color space in CSS Color Level 4. Unlike HSL, equal steps in L produce equal perceived lightness changes — making it ideal for building accessible, harmonious design system scales.

Design Recommendations

Light mid-tone accent

Shade 300 of the Gray palette

Recommended Uses

  • Secondary button outlines
  • Icon strokes on dark backgrounds
  • Progress bar fills
  • Selected state highlights

Avoid

Normal-size text on white — generally below WCAG AA threshold.

Preview

On White

Aa Bb Cc

On Black

Aa Bb Cc

As Background

Aa Bb Cc — #D1D5DB

Frequently Asked Questions

What is the hex code for Tailwind Gray 300?
Tailwind Gray 300 has the hex code #D1D5DB. Its RGB value is rgb(209, 213, 219) and its HSL value is hsl(216, 12%, 84%).
What Tailwind utility classes use Gray 300?
Use bg-gray-300 for backgrounds, text-gray-300 for text color, border-gray-300 for borders, and ring-gray-300 for focus rings. In Tailwind v4 the CSS variable var(--color-gray-300) is available natively.
Is Tailwind Gray 300 WCAG accessible?
Tailwind Gray 300 achieves a 1.47:1 contrast ratio on white (Fail) and 14.25:1 on black (AAA). Its overall accessibility score is 60/100 (Good).
What is the OKLCH value for Tailwind Gray 300?
Tailwind Gray 300 in OKLCH is oklch(0.872 0.009 258) — lightness 0.872, chroma 0.009, hue 258°. OKLCH is a perceptually uniform space supported natively in modern CSS via the `color()` function.
What is Tailwind Gray 300 used for?
At shade 300, Tailwind Gray 300 is best described as "Light mid-tone accent". Recommended uses: Secondary button outlines, Icon strokes on dark backgrounds, Progress bar fills.