"I build design systems
for startups and larger companies."
Assets and design "basis" are often still
managed locally and not at the system scale.
A "zombie styleguide" (Jina Bolton) is an
"abandoned" styleguide, half-living half-dead.
It is often because of a lack of adoption and a
desynchronization between the guide and the production.
Jina Bolton
Nathan Curtis
"Design tokens are the visual design atoms of the design system — specifically, they are named entities that store visual design attributes. We use them in place of hard-coded values [...] in order to maintain a scalable and consistent visual system for UI development."
– Salesforce
Design tokens are...
visual design attributes..
...aiming for:
What can I do?
Every design system offers options.
Options are visual identity properties.
# Colors options# ---------------------blue-base: '#2b7de8'blue-deep: '#38bfea'blue-dark: '#3239e8'grey10: '#262729'grey20: '#313131'grey30: '#4d4d4d'grey40: '#888'grey50: '#aeaeae'grey60: '#ccc'grey70: '#eaeaea'grey80: '#f4f4f4'
What can I do?
Every design system offers options.
Options are visual identity properties.
# Colors options# ---------------------blue-base: '#2b7de8'blue-deep: '#38bfea'blue-dark: '#3239e8'grey10: '#262729'grey20: '#313131'grey30: '#4d4d4d'grey40: '#888'grey50: '#aeaeae'grey60: '#ccc'grey70: '#eaeaea'grey80: '#f4f4f4'
What choice do I make?
Design systems submit decisions.
Decisions are options applied to contexts.
# Colors decisions# ---------------# globalprimary-color: $blue-basetext-color: $grey30body-background: $white# objectsnavbar-link-text-color: $whiteheadband-color: $whitehr-color: $grey40
// Design specifications// ----------------------.c-button { display: inline-block; font-size: $font-size-button; padding: $space-m; color: $text-color; background-color: $white; border-radius: $border-radius-base;}.c-button--primary { background-color: $primary-color; color: $white;}
At the root of the files system
Legible & editable
by anyone
# Typographyfont-family: base: 'Lato, Helvetica' heading: 'Montserrat, Helvetica'font-size: xs: 8px s: 16px m: 20px l: 28px xl: 32px xxl: 40pxfont-weight: light: 300 regular: 400 medium: 500 bold: 700
Opened to everyone to foster
collaboration and maintainability
Tokens are compiled with a task runner
// Compile Design tokens// -----------------------gulp.task('build-token', function() { return gulp.src([paths.designTokens.files]) // transform tokens from yaml into json .pipe(yaml()) // store json .pipe(gulp.dest(paths.designTokens.jsonOutputFolder)) // transform tokens from json into scss .pipe(jsonSass({ delim: '-', })) // store to output folder .pipe(gulp.dest(paths.designTokens.outputFolder));});
Json output
{ "font-family": { "base":"Lato, Helvetica", "heading":"Montserrat, Helvetica" }, "font-size": { "xs":"8px", "s":"16px", "m":"20px", "l":"28px", "xl":"32px", "xxl":"40px" }, "font-weight": { "light":300, "regular":400, "medium":500, "bold":700 }}
Sass output
$font-family-base: Lato, Helvetica;$font-family-heading: Montserrat, Helvetica;$font-size-xs: 8px;$font-size-s: 16px;$font-size-m: 20px;$font-size-l: 28px;$font-size-xl: 32px;$font-size-xxl: 40px;$font-weight-light: 300;$font-weight-regular: 400;$font-weight-medium: 500;$font-weight-bold: 700;
"We define our design in a single location and use a system to cascade it down to all platforms. We call it our Single Source of Truth." - Sönke Rohde, UX engineering at Salesforce.
(schema: Nathan Curtis)
Salesforce created Theo for transforming and formatting Design Tokens
Theo transforms to Lightning (aura), sass, less, stylus, json (ios), xml (android), color swatches (photoshop & sketch).
It can also convert colors and sizing units to different formats.
For smallers companies and agencies, propagation is still relevant.
It allows:
With all the other benefits of the design tokens.
How the Comet design system present its option tokens.
Can our "decision" tokens match our actual decision approach?
"Object-oriented CSS"
// Button definition// ----------------------.c-button { display: inline-block; font-size: $font-size-m; padding: $space-m; color: $text-color; background-color: $white; border-radius: $border-radius-base; &--primary { background-color: $primary-color; color: $white; }}
"Functional CSS"
// "Pure" CSS classes// ----------------------.u-bg-white { background: $white; }.u-bg-grey { background: $grey; }.u-bg-primary { background: $color-primary; }.u-bg-secondary { background: $color-secondary; }.u-white { color: $white; }.u-grey { color: $grey4;}.u-primary { color: $brand-primary; }.u-secondary { color: $brand-secondary; }.u-tertiary { color: $brand-tertiary; }.u-inline-center { text-align: center; }.u-inline-right { text-align: right; }.u-inline-left { text-align: left; }
Classes could be compiled from tokens
// Compile Utility tokens// ----------------------gulp.task('build-utilities', function() { return gulp.src(paths.designUtilities.files) // transform tokens from yaml into json .pipe(yaml()) // store json .pipe(gulp.dest(paths.designUtilities.jsonOutputFolder)) // transform tokens from json into scss .pipe(jsonSassUtilities()) // store to output folder .pipe(gulp.dest(paths.designTokens.outputFolder));});
Input
position: relative: relativebackground-color: bg-blue: *blue bg-green: *green
Output
.u-relative{ position: relative; }.u-bg-blue{ background-color: $blue; }.u-bg-green{ background-color: $green; }
Examples of design systems using Design Tokens:
"I build design systems
for startups and larger companies."
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |