Ring Color
Utilities for setting the color of outline rings.
Show all classes
Use the utilities to set the color of an .
Changing the opacity
Control the opacity of an element’s background color using the color opacity modifier.
<button class="... ring-2 ring-blue-500/50">Subscribe</button>
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:ring-blue-500
to only apply the ring-blue-500
utility on hover.
<div class="ring ring-blue-300 hover:ring-blue-500">
<!-- ... -->
</div>
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:ring-blue-500
to apply the 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: {
},
}
}
}
Alternatively, you can customize just your ring colors by editing theme.ringColor
or theme.extend.ringColor
in your tailwind.config.js
file.
Learn more about customizing the default theme in the documentation.
Arbitrary values
If you need to use a one-off 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.