Usage
Control the text color of an element using the utilities.
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
to apply the text-green
utility at only medium screen sizes and above.
For more information about Tailwind’s responsive design features, check out the Responsive Design documentation.
all
sm
lg
xl
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-blue
to apply the text-blue
utility on hover.
Hover utilities can also be combined with responsive utilities by adding the responsive prefix before the hover:
prefix.
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-blue
to apply the text-blue
utility on focus.
Focus utilities can also be combined with responsive utilities by adding the responsive {screen}:
prefix before the focus:
prefix.
Customizing
By default Tailwind makes the entire available as text colors.
You can customize your color palette by editing the colors
variable in your Tailwind config file, or customize just your text colors using the textColors
section of your Tailwind config.
By default, only responsive, hover and focus variants are generated for text color utilities.
You can control which variants are generated for the text color utilities by modifying the textColors
property in the modules
section of your Tailwind config file.
For example, this config will also generate variants:
If you don’t plan to use the text color utilities in your project, you can disable them entirely by setting the textColors
property to false
in the section of your config file: