Text color

Utilities for controlling the text color of an element


Class reference

ClassProperties
text-currentcolor: currentColor;
Aa
text-transparentcolor: transparent;
Aa
text-black--tw-text-opacity: 1; color: rgba(0, 0, 0, var(--tw-text-opacity));
Aa
text-white--tw-text-opacity: 1; color: rgba(255, 255, 255, var(--tw-text-opacity));
Aa
text-gray-0--tw-text-opacity: 1; color: rgba(253, 248, 255, var(--tw-text-opacity));
Aa
text-gray-100--tw-text-opacity: 1; color: rgba(248, 246, 249, var(--tw-text-opacity));
Aa
text-gray-200--tw-text-opacity: 1; color: rgba(233, 231, 234, var(--tw-text-opacity));
Aa
text-gray-300--tw-text-opacity: 1; color: rgba(207, 203, 206, var(--tw-text-opacity));
Aa
text-gray-400--tw-text-opacity: 1; color: rgba(168, 163, 167, var(--tw-text-opacity));
Aa
text-gray-500--tw-text-opacity: 1; color: rgba(123, 116, 121, var(--tw-text-opacity));
Aa
text-gray-600--tw-text-opacity: 1; color: rgba(81, 75, 79, var(--tw-text-opacity));
Aa
text-gray-700--tw-text-opacity: 1; color: rgba(52, 46, 50, var(--tw-text-opacity));
Aa
text-gray-800--tw-text-opacity: 1; color: rgba(35, 30, 33, var(--tw-text-opacity));
Aa
text-gray-900--tw-text-opacity: 1; color: rgba(26, 18, 23, var(--tw-text-opacity));
Aa
text-gray--tw-text-opacity: 1; color: rgba(233, 231, 234, var(--tw-text-opacity));
Aa
text-violet-0--tw-text-opacity: 1; color: rgba(246, 243, 255, var(--tw-text-opacity));
Aa
text-violet-100--tw-text-opacity: 1; color: rgba(239, 228, 255, var(--tw-text-opacity));
Aa
text-violet-200--tw-text-opacity: 1; color: rgba(220, 196, 255, var(--tw-text-opacity));
Aa
text-violet-300--tw-text-opacity: 1; color: rgba(189, 144, 255, var(--tw-text-opacity));
Aa
text-violet-400--tw-text-opacity: 1; color: rgba(148, 78, 250, var(--tw-text-opacity));
Aa
text-violet-500--tw-text-opacity: 1; color: rgba(104, 12, 233, var(--tw-text-opacity));
Aa
text-violet-600--tw-text-opacity: 1; color: rgba(89, 0, 190, var(--tw-text-opacity));
Aa
text-violet-700--tw-text-opacity: 1; color: rgba(73, 0, 143, var(--tw-text-opacity));
Aa
text-violet-800--tw-text-opacity: 1; color: rgba(53, 0, 97, var(--tw-text-opacity));
Aa
text-violet-900--tw-text-opacity: 1; color: rgba(30, 0, 51, var(--tw-text-opacity));
Aa
text-violet--tw-text-opacity: 1; color: rgba(104, 12, 233, var(--tw-text-opacity));
Aa
text-magenta-0--tw-text-opacity: 1; color: rgba(251, 243, 255, var(--tw-text-opacity));
Aa
text-magenta-100--tw-text-opacity: 1; color: rgba(247, 221, 255, var(--tw-text-opacity));
Aa
text-magenta-200--tw-text-opacity: 1; color: rgba(239, 184, 253, var(--tw-text-opacity));
Aa
text-magenta-300--tw-text-opacity: 1; color: rgba(229, 131, 247, var(--tw-text-opacity));
Aa
text-magenta-400--tw-text-opacity: 1; color: rgba(213, 67, 237, var(--tw-text-opacity));
Aa
text-magenta-500--tw-text-opacity: 1; color: rgba(191, 4, 220, var(--tw-text-opacity));
Aa
text-magenta-600--tw-text-opacity: 1; color: rgba(180, 0, 186, var(--tw-text-opacity));
Aa
text-magenta-700--tw-text-opacity: 1; color: rgba(146, 0, 138, var(--tw-text-opacity));
Aa
text-magenta-800--tw-text-opacity: 1; color: rgba(99, 0, 86, var(--tw-text-opacity));
Aa
text-magenta-900--tw-text-opacity: 1; color: rgba(51, 0, 41, var(--tw-text-opacity));
Aa
text-magenta--tw-text-opacity: 1; color: rgba(191, 4, 220, var(--tw-text-opacity));
Aa
text-blue-0--tw-text-opacity: 1; color: rgba(244, 253, 255, var(--tw-text-opacity));
Aa
text-blue-100--tw-text-opacity: 1; color: rgba(194, 235, 253, var(--tw-text-opacity));
Aa
text-blue-200--tw-text-opacity: 1; color: rgba(144, 201, 247, var(--tw-text-opacity));
Aa
text-blue-300--tw-text-opacity: 1; color: rgba(100, 160, 235, var(--tw-text-opacity));
Aa
text-blue-400--tw-text-opacity: 1; color: rgba(65, 119, 216, var(--tw-text-opacity));
Aa
text-blue-500--tw-text-opacity: 1; color: rgba(39, 83, 191, var(--tw-text-opacity));
Aa
text-blue-600--tw-text-opacity: 1; color: rgba(22, 55, 161, var(--tw-text-opacity));
Aa
text-blue-700--tw-text-opacity: 1; color: rgba(11, 35, 129, var(--tw-text-opacity));
Aa
text-blue-800--tw-text-opacity: 1; color: rgba(5, 21, 96, var(--tw-text-opacity));
Aa
text-blue-900--tw-text-opacity: 1; color: rgba(2, 13, 64, var(--tw-text-opacity));
Aa
text-blue--tw-text-opacity: 1; color: rgba(100, 160, 235, var(--tw-text-opacity));
Aa
text-teal-0--tw-text-opacity: 1; color: rgba(244, 255, 252, var(--tw-text-opacity));
Aa
text-teal-100--tw-text-opacity: 1; color: rgba(190, 248, 236, var(--tw-text-opacity));
Aa
text-teal-200--tw-text-opacity: 1; color: rgba(135, 232, 220, var(--tw-text-opacity));
Aa
text-teal-300--tw-text-opacity: 1; color: rgba(87, 205, 200, var(--tw-text-opacity));
Aa
text-teal-400--tw-text-opacity: 1; color: rgba(50, 164, 168, var(--tw-text-opacity));
Aa
text-teal-500--tw-text-opacity: 1; color: rgba(26, 119, 127, var(--tw-text-opacity));
Aa
text-teal-600--tw-text-opacity: 1; color: rgba(12, 81, 90, var(--tw-text-opacity));
Aa
text-teal-700--tw-text-opacity: 1; color: rgba(5, 54, 62, var(--tw-text-opacity));
Aa
text-teal-800--tw-text-opacity: 1; color: rgba(2, 39, 45, var(--tw-text-opacity));
Aa
text-teal-900--tw-text-opacity: 1; color: rgba(1, 32, 38, var(--tw-text-opacity));
Aa
text-teal--tw-text-opacity: 1; color: rgba(87, 205, 200, var(--tw-text-opacity));
Aa
text-green-0--tw-text-opacity: 1; color: rgba(246, 255, 244, var(--tw-text-opacity));
Aa
text-green-100--tw-text-opacity: 1; color: rgba(192, 248, 190, var(--tw-text-opacity));
Aa
text-green-200--tw-text-opacity: 1; color: rgba(135, 232, 145, var(--tw-text-opacity));
Aa
text-green-300--tw-text-opacity: 1; color: rgba(87, 205, 113, var(--tw-text-opacity));
Aa
text-green-400--tw-text-opacity: 1; color: rgba(50, 168, 87, var(--tw-text-opacity));
Aa
text-green-500--tw-text-opacity: 1; color: rgba(26, 127, 64, var(--tw-text-opacity));
Aa
text-green-600--tw-text-opacity: 1; color: rgba(12, 90, 45, var(--tw-text-opacity));
Aa
text-green-700--tw-text-opacity: 1; color: rgba(5, 62, 32, var(--tw-text-opacity));
Aa
text-green-800--tw-text-opacity: 1; color: rgba(2, 45, 23, var(--tw-text-opacity));
Aa
text-green-900--tw-text-opacity: 1; color: rgba(1, 38, 20, var(--tw-text-opacity));
Aa
text-green--tw-text-opacity: 1; color: rgba(87, 205, 113, var(--tw-text-opacity));
Aa
text-yellow-0--tw-text-opacity: 1; color: rgba(255, 252, 244, var(--tw-text-opacity));
Aa
text-yellow-100--tw-text-opacity: 1; color: rgba(249, 240, 191, var(--tw-text-opacity));
Aa
text-yellow-200--tw-text-opacity: 1; color: rgba(234, 227, 136, var(--tw-text-opacity));
Aa
text-yellow-300--tw-text-opacity: 1; color: rgba(206, 207, 88, var(--tw-text-opacity));
Aa
text-yellow-400--tw-text-opacity: 1; color: rgba(162, 169, 51, var(--tw-text-opacity));
Aa
text-yellow-500--tw-text-opacity: 1; color: rgba(114, 125, 25, var(--tw-text-opacity));
Aa
text-yellow-600--tw-text-opacity: 1; color: rgba(74, 85, 11, var(--tw-text-opacity));
Aa
text-yellow-700--tw-text-opacity: 1; color: rgba(48, 56, 5, var(--tw-text-opacity));
Aa
text-yellow-800--tw-text-opacity: 1; color: rgba(33, 39, 2, var(--tw-text-opacity));
Aa
text-yellow-900--tw-text-opacity: 1; color: rgba(27, 33, 1, var(--tw-text-opacity));
Aa
text-yellow--tw-text-opacity: 1; color: rgba(206, 207, 88, var(--tw-text-opacity));
Aa
text-orange-0--tw-text-opacity: 1; color: rgba(255, 247, 244, var(--tw-text-opacity));
Aa
text-orange-100--tw-text-opacity: 1; color: rgba(253, 208, 188, var(--tw-text-opacity));
Aa
text-orange-200--tw-text-opacity: 1; color: rgba(246, 171, 133, var(--tw-text-opacity));
Aa
text-orange-300--tw-text-opacity: 1; color: rgba(233, 140, 85, var(--tw-text-opacity));
Aa
text-orange-400--tw-text-opacity: 1; color: rgba(214, 114, 47, var(--tw-text-opacity));
Aa
text-orange-500--tw-text-opacity: 1; color: rgba(187, 91, 22, var(--tw-text-opacity));
Aa
text-orange-600--tw-text-opacity: 1; color: rgba(155, 70, 6, var(--tw-text-opacity));
Aa
text-orange-700--tw-text-opacity: 1; color: rgba(121, 53, 0, var(--tw-text-opacity));
Aa
text-orange-800--tw-text-opacity: 1; color: rgba(85, 38, 0, var(--tw-text-opacity));
Aa
text-orange-900--tw-text-opacity: 1; color: rgba(51, 23, 0, var(--tw-text-opacity));
Aa
text-orange--tw-text-opacity: 1; color: rgba(233, 140, 85, var(--tw-text-opacity));
Aa
text-red-0--tw-text-opacity: 1; color: rgba(255, 244, 244, var(--tw-text-opacity));
Aa
text-red-100--tw-text-opacity: 1; color: rgba(253, 194, 196, var(--tw-text-opacity));
Aa
text-red-200--tw-text-opacity: 1; color: rgba(247, 144, 146, var(--tw-text-opacity));
Aa
text-red-300--tw-text-opacity: 1; color: rgba(235, 100, 103, var(--tw-text-opacity));
Aa
text-red-400--tw-text-opacity: 1; color: rgba(216, 65, 68, var(--tw-text-opacity));
Aa
text-red-500--tw-text-opacity: 1; color: rgba(191, 39, 42, var(--tw-text-opacity));
Aa
text-red-600--tw-text-opacity: 1; color: rgba(161, 22, 24, var(--tw-text-opacity));
Aa
text-red-700--tw-text-opacity: 1; color: rgba(129, 11, 13, var(--tw-text-opacity));
Aa
text-red-800--tw-text-opacity: 1; color: rgba(96, 5, 7, var(--tw-text-opacity));
Aa
text-red-900--tw-text-opacity: 1; color: rgba(64, 2, 3, var(--tw-text-opacity));
Aa
text-red--tw-text-opacity: 1; color: rgba(235, 100, 103, var(--tw-text-opacity));
Aa
text-pink-0--tw-text-opacity: 1; color: rgba(255, 244, 255, var(--tw-text-opacity));
Aa
text-pink-100--tw-text-opacity: 1; color: rgba(253, 194, 245, var(--tw-text-opacity));
Aa
text-pink-200--tw-text-opacity: 1; color: rgba(247, 144, 219, var(--tw-text-opacity));
Aa
text-pink-300--tw-text-opacity: 1; color: rgba(235, 100, 182, var(--tw-text-opacity));
Aa
text-pink-400--tw-text-opacity: 1; color: rgba(216, 65, 144, var(--tw-text-opacity));
Aa
text-pink-500--tw-text-opacity: 1; color: rgba(191, 39, 108, var(--tw-text-opacity));
Aa
text-pink-600--tw-text-opacity: 1; color: rgba(161, 22, 78, var(--tw-text-opacity));
Aa
text-pink-700--tw-text-opacity: 1; color: rgba(129, 11, 54, var(--tw-text-opacity));
Aa
text-pink-800--tw-text-opacity: 1; color: rgba(96, 5, 37, var(--tw-text-opacity));
Aa
text-pink-900--tw-text-opacity: 1; color: rgba(64, 2, 23, var(--tw-text-opacity));
Aa
text-pink--tw-text-opacity: 1; color: rgba(235, 100, 182, var(--tw-text-opacity));
Aa
text-light--tw-text-opacity: 1; color: rgba(253, 248, 255, var(--tw-text-opacity));
Aa
text-dark--tw-text-opacity: 1; color: rgba(52, 46, 50, var(--tw-text-opacity));
Aa
text-primary--tw-text-opacity: 1; color: rgba(104, 12, 233, var(--tw-text-opacity));
Aa
text-primary-light--tw-text-opacity: 1; color: rgba(148, 78, 250, var(--tw-text-opacity));
Aa
text-primary-dark--tw-text-opacity: 1; color: rgba(89, 0, 190, var(--tw-text-opacity));
Aa
text-secondary--tw-text-opacity: 1; color: rgba(30, 0, 51, var(--tw-text-opacity));
Aa
text-secondary-light--tw-text-opacity: 1; color: rgba(73, 0, 143, var(--tw-text-opacity));
Aa
text-secondary-dark--tw-text-opacity: 1; color: rgba(53, 0, 97, var(--tw-text-opacity));
Aa
text-info--tw-text-opacity: 1; color: rgba(100, 160, 235, var(--tw-text-opacity));
Aa
text-info-light--tw-text-opacity: 1; color: rgba(144, 201, 247, var(--tw-text-opacity));
Aa
text-info-dark--tw-text-opacity: 1; color: rgba(65, 119, 216, var(--tw-text-opacity));
Aa
text-success--tw-text-opacity: 1; color: rgba(87, 205, 113, var(--tw-text-opacity));
Aa
text-success-light--tw-text-opacity: 1; color: rgba(135, 232, 145, var(--tw-text-opacity));
Aa
text-success-dark--tw-text-opacity: 1; color: rgba(50, 168, 87, var(--tw-text-opacity));
Aa
text-warning--tw-text-opacity: 1; color: rgba(206, 207, 88, var(--tw-text-opacity));
Aa
text-warning-light--tw-text-opacity: 1; color: rgba(234, 227, 136, var(--tw-text-opacity));
Aa
text-warning-dark--tw-text-opacity: 1; color: rgba(162, 169, 51, var(--tw-text-opacity));
Aa
text-danger--tw-text-opacity: 1; color: rgba(235, 100, 103, var(--tw-text-opacity));
Aa
text-danger-light--tw-text-opacity: 1; color: rgba(247, 144, 146, var(--tw-text-opacity));
Aa
text-danger-dark--tw-text-opacity: 1; color: rgba(216, 65, 68, var(--tw-text-opacity));
Aa
text-brand-primary--tw-text-opacity: 1; color: rgba(104, 12, 233, var(--tw-text-opacity));
Aa
text-brand-accent--tw-text-opacity: 1; color: rgba(191, 4, 220, var(--tw-text-opacity));
Aa
text-brand-secondary--tw-text-opacity: 1; color: rgba(30, 0, 51, var(--tw-text-opacity));
Aa
text-brand-dark--tw-text-opacity: 1; color: rgba(37, 13, 46, var(--tw-text-opacity));
Aa

# Usage

Control the text color of an element using the .text-{color} utilities.

The quick brown fox jumped over the lazy dog.

<input class="text-orange-600 ...">

# Changing opacity

Control the opacity of an element’s text color using the .text-opacity-{amount} utilities.

The quick brown fox jumped over the lazy dog.

The quick brown fox jumped over the lazy dog.

The quick brown fox jumped over the lazy dog.

The quick brown fox jumped over the lazy dog.

The quick brown fox jumped over the lazy dog.

<p class="text-violet-600 text-opacity-100">The quick brown fox jumped over the lazy dog.</p>
<p class="text-violet-600 text-opacity-75">The quick brown fox jumped over the lazy dog.</p>
<p class="text-violet-600 text-opacity-50">The quick brown fox jumped over the lazy dog.</p>
<p class="text-violet-600 text-opacity-25">The quick brown fox jumped over the lazy dog.</p>
<p class="text-violet-600 text-opacity-0">The quick brown fox jumped over the lazy dog.</p>

Learn more in the text opacity documentation.

# Responsive

To control the text color of an element at a specific breakpoint, add a {screen}: prefix to any existing text color utility. For example, use md:text-green-600 to apply the text-green-600 utility at only medium screen sizes and above.

<p class="text-violet-600 md:text-green-600 ...">
The quick brown fox...
</p>

For more information about Elements’ responsive design features, check out the Responsive Design documentation.

# Hover

To control the text color of an element on hover, add the hover: prefix to any existing text color utility. For example, use hover:text-violet-600 to apply the text-violet-600 utility on hover.

<button class="text-white hover:text-red-500 ...">
Button
</button>

Hover utilities can also be combined with responsive utilities by adding the responsive {screen}: prefix before the hover: prefix.

<button class="... md:text-blue-400 md:hover:text-blue-500 ...">Button</button>

# Focus

To control the text color of an element on focus, add the focus: prefix to any existing text color utility. For example, use focus:text-violet-600 to apply the text-violet-600 utility on focus.

<input class="text-gray-900 focus:text-red-600 ...">

Focus utilities can also be combined with responsive utilities by adding the responsive {screen}: prefix before the focus: prefix.

<input class="... md:text-gray-900 md:focus:text-red-400 ...">