GC Design System CSS Shortcuts
GC Design System Start to use Page templates overview Basic page Components overview Breadcrumbs Button Card Checkboxes Container Date input Date modified Details Error message Error summary Fieldset File uploader Footer Grid Header Heading Icon Input Language toggle Link Notice Pagination Radios Screenreader-only Search Select Side navigation Signature Stepper Text Textarea Theme and topic menu Top navigation CSS shortcuts overview Reset styles Responsive layout State Box sizing Container sizing Display Overflow Position Visibility Font Font family Font size Font style Font weight Line height Link colour Link size Link text decoration List style Text align Text colour Text overflow Text transform Word break Margin Padding Align content Align items Align self Flex Flex direction Flex grow Flex shrink Flex wrap Gap Grid columns Grid rows Justify content Justify items Justify self Order Place content Place items Place self Background colour Border colour Border radius Border style Border width Icon names Icon size Image Cursor Pointer events Transition Styles overview Design tokens Colour tokens Spacing tokens Typography tokens Contact us Get involved Find a demo

Background colour

The background colour class sets the background-color property. It controls the colour of an element’s background.

View GCDS colour guidance to choose the right background colour for your context.

Overview

CSS Shortcut class Applied style
bg-primary
background-color: var(--gcds-bg-primary);
bg-active
background-color: var(--gcds-active-background);
bg-black
background-color: var(--gcds-color-grayscale-1000);
bg-current
background-color: currentColor;
bg-danger
background-color: var(--gcds-danger-background);
bg-dark
background-color: var(--gcds-bg-dark);
bg-disabled
background-color: var(--gcds-disabled-background);
bg-inherit
background-color: inherit;
bg-light
background-color: var(--gcds-bg-light);
bg-transparent
background-color: transparent;
bg-white
background-color: var(--gcds-bg-white);

Examples

Primary
bg-primary

This element uses the primary Government of Canada accent colour for its background.

<p class="bg-primary text-light">
  This element uses the primary Government of Canada accent colour for its background.
</p>

Active
bg-active

This element uses the active background colour.

<p class="bg-active text-light">
  This element uses the active background colour.
</p>

Black
bg-black

This element uses the black background colour.

<p class="bg-black text-light">
  This element uses the black background colour.
</p>

Current
bg-current

This element uses the background colour based on the current colour property.

<div class="bg-current" style="color: var(--gcds-color-blue-750)">
  <p class="text-light">
    This element uses the background colour based on the current colour property.
  </p>
</div>

Danger
bg-danger

This element uses the danger background colour.

<p class="bg-danger text-light">
  This element uses the danger background colour.
</p>

Dark
bg-dark

This element uses the dark background colour.

<p class="bg-dark text-light">
  This element uses the dark background colour.
</p>

Disabled
bg-disabled

This element uses the disabled background colour.

<p class="bg-disabled">
  This element uses the disabled background colour.
</p>

Inherit
bg-inherit

This element inherits its parent's background colour.

<div class="bg-danger">
  <p class="bg-inherit text-light">
    This element inherits its parent's background colour.
  </p>
</div>

Light
bg-light

This element uses the light background colour.

<p class="bg-light">
  This element uses the light background colour.
</p>

Transparent
bg-transparent

This element has a transparent background colour.

<p class="bg-transparent">
  This element has a transparent background colour.
</p>

White
bg-white

This element has a white background colour.

<div class="bg-dark">
  <p class="bg-white">
    This element has a white background colour.
  </p>
</div>

Conditional styling Apply this style to specific screen sizes Use a responsive layout prefix to apply this class only to a specified screen size. The available breakpoints are:

  • xs: > 480px
  • sm: > 640px
  • md: > 768px
  • lg: > 1024px
  • xl: > 1280px
  
<div class="xs:bg-light ...">
  ...
</div>
  

Learn more about the responsive layout prefix.

Apply this style to specific states Use a state prefix to apply this class only to a specified interaction state. The available states are:

  • hover
  • focus
  
<div class="hover:bg-light ...">
  ...
</div>
  

Learn more about the state prefix.

2026-02-12