@adyen/bento-design-tokens
v2.13.0
Published
Keywords
Readme
Bento Design Tokens
Introduction
Welcome to the Bento Design Tokens library!
The aim of this library is to maintain design consistency across various products at Adyen.
Design tokens are semantic values that are used in Figma designs and CSS styles.
Style Dictionary
We have opted to use the Style Dictionary token creation tool that resides in the
@adyen/bento-design-tokens package.
The Style dictionary uses 3 layers of tokens:
Definitions - All the static literal definitions
Example: color.grey.30Aliases - Semantic layer of tokens relating to a specific context or abstraction
Example: background-color-interactedComponents - Component-specific tokens are representation of every theme-able value associated with a component
Example: toggle-checked-background-colorFor further explanation please check Adobe Spectrum documentation.
Design tokens package:
The design tokens package tokens folder contains 2 folders:
- base
- aliases (read-only)
- components
- definitions (read-only)
- themes
- dark
- aliases
- components
- definitions
- dark
Theme stylesheets
The light theme is published as a complete stylesheet. The dark theme and the large scale are published as add-on
stylesheets containing changed declarations and the aliases that reference them. Their names distinguish the color theme
(theme-dark) from the size scale (scale-large).
| Stylesheet | Contains | Activated by |
| --------------------------- | ---------------------------- | ------------------------------------------- |
| variables.css | Every token, light values | :root |
| variables-theme-dark.css | Dark add-on | b-dark-theme, b-large-dark-theme |
| variables-scale-large.css | Large spacing and typography | b-large-light-theme, b-large-dark-theme |
Import variables.css first, then only the add-ons the application supports, in this order:
@import '@adyen/bento-design-tokens/dist/css/bento/variables.css';
@import '@adyen/bento-design-tokens/dist/css/bento/variables-theme-dark.css';
@import '@adyen/bento-design-tokens/dist/css/bento/variables-scale-large.css';The theme classes are the ones setTheme() already applies, so switching themes needs no change.
⚠️ Complete dark and large stylesheets deprecated ⚠️
variables-dark.css, variables-large-light.css, and variables-large-dark.css are deprecated and will be removed in
v3.0.0. They keep working until then. Please import variables.css with the add-ons above instead; do not combine both.
