Skip to main content

Outline

Adjust the thickness and color of an item's outline



Properties

Outline thickness

Outlines can only accept these 4 values for thickness.

Utility class Description Example
.outline-0 Outline width: 0 (turn outlines off)
.outline-1px Outline width: 1px
.outline-2px Outline width: 2px
.outline-05 Outline width: 4px

Outline color

An element requires an outline thickness in order to apply an outline color.

Utility class Description Example
.outline-primary 1px outline in the primary color
.outline-secondary-dark 2px outline in the secondary-dark color
.outline-accent-warm-dark 4px outline in the accent-warm-dark color


Utility classes

Utility classes may be included in your HTML or applied using Utility classes in your Sass.

Utility Example Code
.outline-token .outline-05 class=("outline-05")
.outline-color .outline-accent-warm-light class=("outline-05 outline-accent-warm-light")

  • Use single-quoted strings in Utility classes.
  • Do not quote numbers or px values. With the exception of half (05), values like '105', and '205' should be treated as strings.
  • String tokens for half values (like 05) and negative values (like neg-1) may also be written with their unquoted number token equivalent: 0.5, 1.5, 2.5, -1, -1.5, etc.
  • If multiple utilities share the same prefix (ex: .text- or .flex-) or a single utility accepts multiple kinds of values (ex: .border accepts both border weight and border color), their shared mixin can accept multiple comma-separated values:
    • u-text('primary-darkest', 'no-underline', 'bold')
    • u-border-top(2px, 'accent-warm')
  • Output any utility mixin as !important by appending !important to the mixin’s argument list:
    • u-bg('red-warm-50v', !important)


Utility variants

More information about utility variants can be viewed on the utility variants page. Responsive and state variants are listed as true when they are available for use.

Responsive variants

You can apply different styles at differentresponsive breakpoints using responsive utilities. Use a breakpoint prefix separated with a : to target a utility at a responsive breakpoint and higher (eg. .desktop:border-05).

Utility variable Responsive
$outline-settings false
$outline-color-settings false

State variants

You can apply different styles for different state variants using state utilities. Use a state prefix separated with a : to target a utility for a specific state. (eg. .hover:shadow-2).

Utility variable Active Focus Hover Visited
$outline-settings false false false false
$outline-color-settings false false false false
Looking for U.S. government information and services?
Visit USA.gov