Francesco Improta
Product Designer. Passionate by mountains, astronomy and code. Dad in real life.
$ds-color-background-primary
$button-text-size-lg
[system]-[category]-[property]-[variant]
[component]-[category]-[property]-[scale]
--color-specific-data-entry-border-color-default
Properties are in bold
$button-danger
$color-background-info
$color-text-strong-dark
$color-background-primary-on-light
Using the modifier level impose you to specify both light and dark variant
$dark-color-text-strong
Easy to align with design tools like Figma
// Good
$card-radius
$card-shadow-offset
// Bad, redundant
$card-tile-corner-radius-default-on-light
$card-corner-radius-default-on-dark
$card-shadow-offset-default-on-light
$card-shadow-offset-default-on-dark
Using tokens inside CSS classes
Class name should reflect the scope, not only the usage. For utility class too.
.spacing-stack {
margin-bottom: var(--spacing-stack-xl);
@media screen and (min-width: 768px) {
margin-bottom: var(--spacing-stack-xxl);
}
}
.spacing-stack tell us about the vertical space alignment, nothing more. But we use two tokens inside it
.spacing-sections {
margin-bottom: var(--spacing-stack-xl);
@media screen and (min-width: 768px) {
margin-bottom: var(--spacing-stack-xxl);
}
}
.spacing-sections tell us more about the scope - spacing a page section > more defined range > not a utility because two tokens usage > object class (ITCSS)
Space rivals color in frequency of use within a library’s style rules
A visual reference, akin to a cheatsheet, of spatial concepts
Space epitomizes the “I design this way, you build that way” gap between design and dev
Gonzalo Vásquez on Design Tokens
By Francesco Improta
Product Designer. Passionate by mountains, astronomy and code. Dad in real life.