Tailwind Text Color
In this article, we will explore the different ways to set the text color with Tailwind text colors.
Text color plays a crucial role in web design, as it affects readability and visual appeal.
Choosing the right color for your text can help make it stand out and draw attention to significant information on your website.
The text color utility in Tailwind CSS can be used to set the color of text displayed on the screen.
Tailwind Text Color Classes
You can set the text color of an element using a range of Tailwind text color classes:
|text-inherit||The text will inherit the parent element color.|
|text-current||This class is used to set the text color to its current text color.|
|text-transparent||The color property of the text element is set to transparent using this class.|
|text-black||As a result, the resulting text color is black.|
|text-white||Using this class, the text color is set to white.|
|text-slate-50||The purpose of this class is to assign a shade of grayish blue color to the text of an element.|
|text-gray-50||This class is utilized to assign a shade of gray color to the text element.|
|text-zinc-50||The text color is set to a shade of grayish green color.|
|text-neutral-50||The resulting text is a shade of grayish neutral in color.|
|text-stone-50||As a result of this class, the text is a shade of grayish brown in color.|
|text-red-50||The color of the text element using this class is a shade of red.|
|text-orange-50||A shade of orange color is used for the text color.|
|text-amber-50||The text color is set to a shade of amber using this class.|
|text-yellow-50||This class is utilized to apply a shade of yellow color to the text element.|
|text-lime-50||The purpose of this class is to set the color of the text element to a shade of lime.|
|text-green-50||The color property of the text is set to a shade of green using this class.|
|text-emerald-50||It sets the text color to a shade of light green.|
|text-teal-50||In this case, the text is blueish-green in color.|
|text-cyan-50||This class is used to set the text color to a shade of cyan.|
|text-sky-50||It sets the text color to a shade of blue.|
|text-blue-50||A shade of blue color is used to display the text.|
|text-indigo-50||The resulting text element’s color is set to a shade of indigo.|
|text-violet-50||Text is displayed on the screen using a shade of violet.|
|text-purple-50||This class is utilized to set the text color to a shade of purple.|
|text-fuchsia-50||A shade of pinkish-purple color is used to display the text.|
|text-pink-50||A shade of pink color is used for displaying text.|
|text-rose-50||The purpose of this class is to set the color of the text element to a shade of rose.|
Text opacity can be adjusted using the color opacity modifier such as applying 50% opacity to text-black using the class “text-black/50”.
The opacity values that can be used are defined in the opacity class article.
You can also use arbitrary values for specifying opacity such text-black/[0.5] is used for applying 50% opacity to black text.
This example illustrates the various Tailwind text color classes for a better visualization: