Design tokens
GC Design System tokens are the smallest building blocks of the design system.
Capturing design decisions in code
We've created a token to define each style decision in GC Design System. All of our components use tokens.
Design tokens are the documentation of design decisions in variables, reusable pieces of code. They replace any hard-coded values, like colour codes and pixels.
Scaling styles across your code
Design tokens are made for reuse throughout the entire code base. When we update a gcds-token, the change is passed on to every component and block of code using that token.
Colour, spacing, and typography tokens are applied consistently across components, pages, and products. The token gives you the exact match for your purpose without chart lookups or guesswork.
Design token types
Component design tokens
GC Design System components have their own tokens. These component tokens are component-specific. Using them elsewhere can cause you problems.
When misused component tokens can change unexpectedly. They receive updates any time the component they're attached to gets updated.
Global design tokens
Global design tokens (including tokens for states) are made to be used by component tokens and by you. They often form part of component tokens.
Global tokens are semantic. That means they have meanings or contexts associated with them. You can use them based on their stated purpose for your product design.
Global tokens help you minimize future maintenance and establish a visual language for stronger communications.
Base design tokens
Base tokens are for you to use when you've run out of global token options. GC Design System base tokens offer a range of style options to complement the global colour tokens palette.
Base tokens are not semantic so it's harder for everyone to understand what they represent. It's important to use them thoughtfully and consistently to support a familiar and predictable user experience for your service.
Token anatomy and naming progression
Tokens are characterized by a naming progression.
- The prefix
--gcds-
differentiates GC Design System tokens from other, external tokens or variables. - The category states the component, property, state, or colour depending on the type of token.
- The role specifies the component sub-type, like primary, secondary, danger, etc.
- The state cites the interaction or data state, like default, hover, focus, etc.
- The property refers to the specific CSS property the token's being applied to, like
background
,border
,color
, etc. - The scale refers to one of a set of proportionally increasing shades, sizes, or weights.
Component design token
Global design token
Global design token – global state
Base design tokens
Help us improve
Have questions or a request? Give feedback on our contact form.
Something's wrong? Raise it through GitHub with an