A design token is a key-value pair that represents a single piece of a design system's visual style. These tokens are used to store design decisions such as colors, typography, spacing, and other properties in a format that can be easily consumed and applied across different platforms and environments.
Atomic Elements:
Design tokens capture the smallest possible pieces of design decisions, like color values, font sizes, or spacing units.
Consistency:
Using tokens ensures that the same design values are used consistently across various components and screens.
Platform Agnostic:
Tokens can be transformed into different formats suitable for various platforms (e.g., CSS, JavaScript, iOS, Android), ensuring consistency across web, mobile, and other environments.
Scalability:
They enable easy updates and scalability. Changing a token value in one place can propagate that change throughout the entire system.
Themability:
Design tokens can be used to create themes. For example, dark and light themes can use different sets of tokens.
Color Tokens:
Store color values (e.g., primary, secondary, and background color).
Typography Tokens:
Define font-related properties (e.g., font family, font size, font weight).
Spacing Tokens:
Specify spacing units (e.g., margins, paddings, gaps).
Sizing Tokens:
Define size values (e.g., width, height).
Border Tokens:
Capture border properties (e.g., border width, border radius).
Shadow Tokens:
Represent shadow styles (e.g., box shadow, text shadow).
In JSON format, design tokens might look like this:
{
"color": {
"primary": "#FF5733",
"secondary": "#33CFFF",
"background": "#FFFFFF"
},
"typography": {
"fontFamily": "Arial, sans-serif",
"fontSize": {
"small": "12px",
"medium": "16px",
"large": "24px"
}
},
"spacing": {
"small": "8px",
"medium": "16px",
"large": "32px"
}
}
Centralized Control:
Makes it easier to manage and update design values from a single place.
Improved Collaboration:
Designers and developers have a common reference, reducing misunderstandings.
Efficiency:
Speeds up the development process by providing ready-to-use values.
Quality and Consistency:
Ensures a uniform look and feel across all parts of the application.
In summary, design tokens are fundamental building blocks in a design system, providing a structured and scalable way to manage design decisions across different platforms and components.
This article was originally published on the blog of industry thought leader and dotCMS’s VP of Product, Preston So, and is the first of a multi-part blog series discussing the future of content manag...
The rise of the headless CMS has been a boon for developers, but at the expense of content managers; it has forced business users back to the 2000s, where the key to all progress lies in developer mus...
Implementing a Content Security Policy and Permission Policy is more straightforward than people might think, and there are many resources available to guide developers through the process.