GC Design System Styles
Home 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

Colour tokens

Colour tokens define colour for components and global styles.

Colour tokens and accessibility

GC Design System components meet level AA of the Web Content Accessibility Guidelines (WCAG 2.1) colour contrast standards for text and interactive elements.

When you use global tokens, check if your colour combinations meet standards for accessible colour contrast using WebAIM Contrast Checker.

Select colour tokens purposefully

Select global tokens based on their purpose and its match to your needs.

Replace hard-coded values in your code with GC Design System colour tokens, like var(--gcds-text-primary) instead of #000000.

Global colour tokens

Use global tokens to:

  • Design layouts, text colours, and global (or site-wide) styles for typography or spacing.
  • Communicate the meaning associated with that token. Global tokens are semantic.
  • Create new component tokens.

Use global state tokens:

  • Apply standard styling for states to your own components.

Text

PreviewToken nameContrast ratioHexPurpose
--gcds-text-light1#FFFMain light text colour. Use on a background shade of 700 or darker (like --gcds-bg-dark).
--gcds-text-primary12.63#333333Main text colour. Use on a background shade of 50 or lighter (like --gcds-bg-white).
--gcds-text-secondary9.33#43474EContrast text colour (alternative to primary). Use on a background shade of 50 or lighter (like --gcds-bg-white).
PreviewToken nameContrast ratioHexPurpose
--gcds-link-default10.38#284162Default link colour for links on a white background.
--gcds-link-hover8.58#0535d2Hover link colour for links on a white background.
--gcds-link-light1#FFFMain light link colour for links on 700 shade or darker background (like --gcds-color-blue-700).
--gcds-link-visited7.22#7532B8

Background

PreviewToken nameContrast ratioHexPurpose
--gcds-bg-dark12.63#333333Main dark background colour. Use with a text shade of 100 or lighter (like --gcds-text-light).
--gcds-bg-light1.12#F1F2F3Light background colour (alternative to white). Use with a text shade of 700 or darker (like --gcds-text-primary).
--gcds-bg-primary12.15#26374AHighlight background colour. Use with a text shade of 100 or lighter (like --gcds-text-light).
--gcds-bg-white1#FFFMain background colour. Use with a text shade of 700 or darker (like --gcds-text-primary).

Border

PreviewToken nameContrast ratioHexPurpose
--gcds-border-default3.86#7D828BDefault border colour for borders and icons on a white background.

Danger

PreviewToken nameContrast ratioHexPurpose
--gcds-danger-background1.27#FBDDDADanger background colour for background emphasis on a destructive action or critical feedback.
--gcds-danger-border5.51#d3080cDanger border colour for borders on white or danger backgrounds for emphasis on a destructive action or critical feedback.
--gcds-danger-text7.06#A62A1EDanger text colour for white or danger backgrounds for emphasis on a destructive action or critical feedback.

Disabled

PreviewToken nameContrast ratioHexPurpose
--gcds-disabled-background1.41#D6D9DDDisabled background colour. Use sparingly for a disabled interactive element.
--gcds-disabled-text7.05#545961Disabled text colour. Use sparingly for a disabled interactive element.

Focus

PreviewToken nameContrast ratioHexPurpose
--gcds-focus-background8.58#0535d2Focus background colour, exclusively for focus on an interactive element.
--gcds-focus-border8.58#0535d2
--gcds-focus-text1#FFFFocus text colour, exclusively for focus on an interactive element.

Base colour tokens

Only use base tokens when you've already checked for global tokens and you need something else for building your own components, tokens, or even images.

Use base design tokens to:

  • Fill a gap when no global tokens are available.
  • Design a custom visual, drawing from the full colour palette.
  • Support your own components.
  • Provide a basis to build (and potentially contribute back) your own tokens.
PreviewToken nameContrast ratioHexPurpose
--gcds-color-grayscale-01#FFF
--gcds-color-grayscale-501.12#F1F2F3
--gcds-color-grayscale-1001.41#D6D9DD
--gcds-color-grayscale-3002.25#A8ADB4
--gcds-color-grayscale-5003.86#7D828B
--gcds-color-grayscale-7007.05#545961
--gcds-color-grayscale-8009.33#43474E
--gcds-color-grayscale-90012.63#333333
--gcds-color-grayscale-100021#000
--gcds-color-blue-1001.27#D7E5F5
--gcds-color-blue-5003.88#6584A6
--gcds-color-blue-65010.38#284162
--gcds-color-blue-7009.67#33465c
--gcds-color-blue-7504.85#1E7B96
--gcds-color-blue-8009.47#2b4380
--gcds-color-blue-8508.58#0535d2
--gcds-color-blue-90012.15#26374A
--gcds-color-red-1001.27#FBDDDA
--gcds-color-red-5005.51#d3080c
--gcds-color-red-7007.06#A62A1E
--gcds-color-red-9009.63#822117
--gcds-color-red-flag4.23#eb2d37
--gcds-color-green-1001.11#E6F6EC
--gcds-color-green-5003.39#289F58
--gcds-color-green-7007.14#03662A
--gcds-color-green-80012.78#023b1a
--gcds-color-yellow-1001.16#FAEDD1
--gcds-color-yellow-5003.49#B3800F

Note: Code elements take American spelling for "colour" and "grey".

Help us improve

Have questions or a request? Give feedback on our contact form.

Something's wrong? Raise it through GitHub with an account. You'll have access to the team's direct responses, progress made on your issue, and issues raised by others.

Give feedback Report an issue on GitHub

2024-05-08