Border & OutlineOutline Offset

Outline Offset

Controls the offset of an element's outline.

Widely available

This feature is well established and works across many devices and browser versions.

Chrome
Edge
Firefox
Safari
ClassStyle
oo-0outline-offset: 0px;
oo-1outline-offset: 1px;
oo-2outline-offset: 2px;
oo-3outline-offset: 3px;
oo-4outline-offset: 4px;

This example showcases various outline-offset values:

  • The 1px outline offset utility places the outline 1 pixel away from the border of the element.
  • The 2px outline offset utility places the outline 2 pixels away from the border of the element.
  • The 3px outline offset utility places the outline 3 pixels away from the border of the element.
<div class="d-g g-16 gtc-1 sm:gtc-3">
<div class="b-1 bc-indigo d-16 oc-indigo oo-1 os-s"></div>
<div class="b-1 bc-indigo d-16 oc-indigo oo-2 os-s"></div>
<div class="b-1 bc-indigo d-16 oc-indigo oo-3 os-s"></div>
</div>

Using utility variants

Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.

Targeting different viewports

You can combine responsive breakpoints like sm:oo-*, md:oo-*, lg:oo-*, and xxl:oo-* to allow targeting specific utilities in different viewports.

Targeting hover states

Alternatively, you can apply :hover by using h:oo-* utility to override elements and change their values when hovering over them.