Skip to main content

Background Color

Set the background color of an element.

Additional color guidance



Background colors

Background - base

CSS Class Hex Code RGB Example
.bg-base-lightest #f0f0f0 240, 240, 240
.bg-base-lighter #dfe1e2 223, 225, 226
.bg-base-light #a9aeb1 169, 174, 177
.bg-base #71767a 113, 118, 122
.bg-base-dark #565c65 86, 92, 101
.bg-base-darker #3d4551 61, 69, 81
.bg-base-darkest #1b1b1b 27, 27, 27
.bg-ink #1b1b1b 27, 27, 27

Background - primary

CSS Class Hex Code RGB Example
.bg-primary-lighter #DEE8E0 222, 232, 224
.bg-primary-light #B2C9B7 178, 201, 183
.bg-primary #4D8157 77, 129, 87
.bg-primary-dark #236430 35, 100, 48
.bg-primary-darker #1A4B24 26, 75, 36

Background - secondary

CSS Class Hex Code RGB Example
.bg-secondary-lighter #DEE5EF 222, 229, 239
.bg-secondary-light #BCCCDF 188, 204, 223
.bg-secondary #4F78AA 79, 120, 170
.bg-secondary-dark #205493 32, 84, 147
.bg-secondary-darker #183F6E 24, 63, 110

Background - accent-cool

CSS Class Hex Code RGB Example
.bg-accent-cool-lighter #F5ECE1 245, 236, 225
.bg-accent-cool-light #E8D3B3 232, 211, 179
.bg-accent-cool #C97B3E 201, 123, 62
.bg-accent-cool-dark #9B5028 155, 80, 40
.bg-accent-cool-darker #6A2F18 106, 47, 24

Background - accent-warm

CSS Class Hex Code RGB Example
.bg-accent-warm-lighter #DFF9F4 223, 249, 244
.bg-accent-warm-light #A7EDE4 167, 237, 228
.bg-accent-warm #3FA39A 63, 163, 154
.bg-accent-warm-dark #2A7A6F 42, 122, 111
.bg-accent-warm-darker #154D41 21, 77, 65

Background - grayscale

CSS Class Hex Code RGB Example
transparent #00000000 0, 0, 0, 0
white #ffffff 255, 255, 255
.bg-gray-5 #f0f0f0 240, 240, 240
.bg-gray-10 #e6e6e6 230, 230, 230
.bg-gray-30 #adadad 173, 173, 173
.bg-gray-50 #757575 117, 117, 117
.bg-gray-70 #454545 69, 69, 69
.bg-gray-90 #1b1b1b 27, 27, 27
.bg-black #000000 0, 0, 0

Background - basic

CSS Class Hex Code RGB Example
.bg-red #e52207 229, 34, 7
.bg-orange #e66f0e 230, 111, 14
.bg-gold #ffbe2e 255, 190, 46
.bg-yellow #fee685 254, 230, 133
.bg-green #538200 83, 130, 0
.bg-mint #04c585 4, 197, 133
.bg-cyan #009ec1 0, 158, 193
.bg-blue #0076d6 0, 118, 214
.bg-indigo #676cc8 103, 108, 200
.bg-violet #8168b3 129, 104, 179
.bg-magenta #d72d79 215, 45, 121


Utility classes

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

Utility Example Code
.bg-color .bg-primary-darker class=("bg-primary-darker")

  • 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 different responsive 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
$background-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
$background-color-settings false false true false
Looking for U.S. government information and services?
Visit USA.gov