Skip to main content

bg-gray-900

Tailwind Gray 900

#111827·Gray family·Shade 900

Color Values

HEX
#111827
RGB
rgb(17, 24, 39)
HSL
hsl(221, 39%, 11%)
OKLCH
oklch(0.210 0.032 265)
CMYK
cmyk(56%, 38%, 0%, 85%)
CSS Variable
var(--color-gray-900)
Tailwind Class
bg-gray-900

Accessibility Score

60/100

Good

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

On White

17.74:1

AAA

On Black

1.18:1

Fail
Test in Contrast Checker →

Tailwind Usage — All Utilities

Background

bg-gray-900

Text

text-gray-900

Border

border-gray-900

Ring

ring-gray-900

Outline

outline-gray-900

Fill

fill-gray-900

Stroke

stroke-gray-900

From (gradient)

from-gray-900

Via (gradient)

via-gray-900

To (gradient)

to-gray-900

Placeholder

placeholder-gray-900

Caret

caret-gray-900

Accent

accent-gray-900

Decoration

decoration-gray-900

Shadow Color

shadow-gray-900

Tailwind v3 Config (extend custom color)

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

CSS Equivalent

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

/* RGB */
background-color: rgb(17, 24, 39);

/* HSL */
background-color: hsl(221, 39%, 11%);

/* OKLCH (CSS Color Level 4) */
background-color: oklch(0.210 0.032 265);

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

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

OKLCH — Modern Color Space

Lightness (L)

0.210

21% perceived brightness

Chroma (C)

0.032

Color intensity / saturation

Hue (H)

265°

Angle on perceptual hue wheel

oklch(0.210 0.032 265)

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

Strong dark tone

Shade 900 of the Gray palette

Recommended Uses

  • Body text on white
  • Dark panel backgrounds
  • Near-dark UI elements
  • Footer backgrounds
  • High-contrast headings

Avoid

On dark backgrounds — contrast will be insufficient.

Preview

On White

Aa Bb Cc

On Black

Aa Bb Cc

As Background

Aa Bb Cc — #111827

Frequently Asked Questions

What is the hex code for Tailwind Gray 900?
Tailwind Gray 900 has the hex code #111827. Its RGB value is rgb(17, 24, 39) and its HSL value is hsl(221, 39%, 11%).
What Tailwind utility classes use Gray 900?
Use bg-gray-900 for backgrounds, text-gray-900 for text color, border-gray-900 for borders, and ring-gray-900 for focus rings. In Tailwind v4 the CSS variable var(--color-gray-900) is available natively.
Is Tailwind Gray 900 WCAG accessible?
Tailwind Gray 900 achieves a 17.74:1 contrast ratio on white (AAA) and 1.18:1 on black (Fail). Its overall accessibility score is 60/100 (Good).
What is the OKLCH value for Tailwind Gray 900?
Tailwind Gray 900 in OKLCH is oklch(0.210 0.032 265) — lightness 0.210, chroma 0.032, hue 265°. OKLCH is a perceptually uniform space supported natively in modern CSS via the `color()` function.
What is Tailwind Gray 900 used for?
At shade 900, Tailwind Gray 900 is best described as "Strong dark tone". Recommended uses: Body text on white, Dark panel backgrounds, Near-dark UI elements.