2. Luděk Vepřek
• Frontend Developer at Kiwi.com
• Working on our Design System called Orbit
• 5+ years of experience with design and frontend development
• I used to be a graphic designer
9. Design tokens are atomic pieces that store visual design attributes.
We could define them in: SASS, JSON, JS and other formats.
What are design tokens?
10. Every token name starts with its related CSS property, like color,
background or font-size. This help us to use them more naturally.
property_usage-type--state
propertyUsageTypeState: value
We also divided tokens into two types: generic and specific
Naming taxonomy
13. Design tokens are like variables, but they are more than that.
They are visual design attributes that are stored & centralised,
organised and propagated.
17. What do we have in our foundation?
• 23 colors (we have hover/active colors also = 55 colors)
• 37 base tokens:
• fontFamily, fontWeight, fontSize, borderRadius, sizing, spacing,
opacity, transitions, lineHeight and boxShadows
19. By definition of foundation, it’s pretty easy to add functionality in Javascript
to be able support branding.
20. Branding function
import { palette, base } from "./foundation"
function getTokens(custom) {
// merge defaults with custom
const foundation = {
palette: Object.assign({}, palette, custom.palette),
base: Object.assign({}, base, custom.base),
};
return {
// font-size
fontSizeButtonSmall: foundation.base.fontSizeSm, // 12px
fontSizeTextSmall: foundation.base.fontSizeSm, // 12px
...
};
21. Branding function
const brand = {
base: {
fontSizeSm: "10px",
},
};
const tokens = getTokens(brand);
console.log(tokens); // what will be the output?
22. The result
tokens = {
fontSizeButtonSmall: "10px", // 12px before
fontSizeTextSmall: "10px", // 12px before
...
}
27. Summary
Design tokens can help us:
• to be able to change Kiwi.com's visual look easily
• to be able to adjust our product for different partners
• keep visual design consistent across different platforms
The best thing?
All that is managed from one place!
28. Thank you for your attention.
Any questions?
Luděk Vepřek
@elvepor