GC Design System Components Installation Page templates Contact us Get involved Find a demo GC Design System Styles

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:

Use global state tokens:

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-default9.47#2b4380Default 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:

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-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