Ring offset width
Utilities for simulating an offset when adding outline rings.
Class reference
Usage
Use the ring-offset-{width}
utilities to simulate an offset by adding solid white box-shadow and increasing the thickness of the accompanying outline ring to accommodate the offset.
Changing the offset color
You can’t actually offset a box-shadow in CSS, so we have to fake it using a solid color shadow that matches the parent background color. We use white by default, but if you are adding a ring offset over a different background color, you should use the ring-offset-{color}
utilities to match the parent background color:
For more information, see the ring offset color documentation.
Responsive
To control the ring offset width at a specific breakpoint, add a {screen}:
prefix to any existing ring offset width utility. For example, use md:ring-offset-4
to apply the ring-offset-4
utility at only medium screen sizes and above.
<button class="ring-2 ring-offset-2 md:ring-offset-4">
<!-- ... -->
</button>
For more information about Elements’ responsive design features, check out the Responsive Design documentation.
On this Page
v1.13.5