Text Decoration Color
Utilities for controlling the color of text decorations.
Show all classes
Use the utilities to change the color of an element’s .
Changing the opacity
Control the opacity of an element’s text decoration color using the color opacity modifier.
<div>
<p>
I’m Derek, an astro-engineer based in Tattooine. I like to build X-Wings at
<a class="underline decoration-sky-500/30">My Company, Inc</a>.
Outside of work, I like to <a class="underline decoration-pink-500/30">watch
pod-racing</a> and have <a class="underline decoration-indigo-500/30">light-saber</a> fights.
</p>
</div>
You can use any value defined in your , or use arbitrary values if you need to deviate from your design tokens.
Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:decoration-blue-400
to only apply the utility on hover.
<p class="underline decoration-sky-600 hover:decoration-blue-400">
</p>
For a complete list of all available state modifiers, check out the Hover, Focus, & Other States documentation.
Breakpoints and media queries
You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:decoration-blue-400
to apply the decoration-blue-400
utility at only medium screen sizes and above.
To learn more, check out the documentation on Responsive Design, and other media query modifiers.
tailwind.config.js
module.exports = {
extend: {
colors: {
'regal-blue': '#243c5a',
},
}
}
Alternatively, you can customize just your text decoration colors by editing theme.textDecorationColor
or theme.extend.textDecorationColor
in your file.
Learn more about customizing the default theme in the documentation.
Arbitrary values
If you need to use a one-off text-decoration-color
value that doesn’t make sense to include in your theme, use square brackets to generate a property on the fly using any arbitrary value.
Learn more about arbitrary value support in the documentation.