Tokens

The Torq system is built upon design tokens to standardise the core styling of UI components.

Overview

Design tokens are central and tiny pieces of UI information to store design related information such as colours, fonts, spaces, animations, etc.Design tokens are all the values needed to construct and maintain a design system — spacing, colour, typography etc. — represented as data. These can represent anything defined by design: a colour as a HEX value, opacity as a number, spacing as pixels.They're used in place of hard-coded values in order to ensure flexibility and unity across all product experiences.
Brand token
t/semantic/colour/primary/500
Background token
t/semantic/bg_color_light/primary/default
Colour mode token
t/semantic/colour/accent/default
Component token
t/component/buttons/base/primary/primary-brand/colour/background/enabled

Naming convention example

tSystem
.
componentTier
.
feedbackComponent group
.
alertComponent
.
borderCategory
.
radiusComponent
.
defaultScale
t.component.feedback.alert.border.radius.default
tSystem
componentTier
feedbackComponent group
alertComponent
borderCategory
radiusComponent
defaultScale

Why use design tokens?

The benefit of design tokens is that they can be transformed and formatted to meet the needs of any platform (Android, iOS, Web, etc) they can also be used for branding or theming for customers, and configurable settings-based theming like dark mode.Design tokens allow product teams to better collaborate and ensure brand consistency across any platform. They ease collaboration between product teams and ensure brand consistency throughout any targeted platform.Design tokens are directly integrated into our component libraries and UI kits. They cover the various options of platform scales, colour themes, component states, and more.Themes provide a consistent look and feel across pages with varied functionality. It also makes it simple to implement and maintain theming across the app.
  1. Torq would update the colour in the design tool across all platform (web, iOS and Android)
  2. The design tool updates design tokens files.
  3. Developers only have to retrieve or “pull” updated files and use them in their project

When to use

  • Use design tokens whenever possible, particularly when exploring hierarchy through typography and spacing.
  • Integrate design tokens into the project setup to establish a consistent and shared styling foundation. Ensure a unified styling approach from the outset, promoting scalability and ease of maintenance.
  • Apply design tokens to handle responsive design challenges, defining breakpoints and spacing values as adaptable tokens.
  • Include design tokens when designers and developers collaborate to provide a clear style specification. Developers can easily reference and implement design tokens, fostering a smooth transition from design to development.
  • Use design tokens as the design evolves to make global style updates efficiently. Maintain a cohesive design language without the need for manual updates to individual components.
  • Implement theming using design tokens to support different visual variations or themes within the application.

How to use

  • All Torq components reference tokens, so by using Torq you're automatically using the correct design tokens.
  • Ensure that you have access to the design tokens in your project. For designers, make sure you have the Torq library turned on in your file. For developers, design tokens are defined in a centralised file or location.
  • In Figma, you can access the design tokens for colour and shading through the design panel on the right. Avoid using hard-coded values such as HEX codes in your designs.
  • When creating your designs, collaborate closely with developers to ensure that your design vision aligns with the technical aspects of token usage; don't make design decisions in isolation.
  • Test your designs with various design token values, especially in different themes or layouts. This helps identify potential issues and ensures that your designs are versatile across diverse scenarios.
  • Consistency is key to a cohesive user experience. Refrain from deviating from the tokens established in the design system.