style-tokens
A design token module for Hub backed by style-dictionary.
Available Hub style tokens
#
Installation#
ExportsStyle tokens exports 2 different files for each type: tokens.{ext}
and tokens-accessibility.{ext}
. The latter uses a new color schema for better contrast, improving accessibility. The following examples work for both exports, and you will only need to change the filename.
#
Examples#
Javascript / TypeScriptUse the exported constants in your components.
index.ts
Use it with accessibility.
index.tsx
#
CSS VariablesSee MDN's documentation on CSS variables
Include the CSS file in your project.
index.tsx
Use the variables within CSS files.
index.css
#
SCSSindex.scss
index.tsx
#
Lessindex.less
index.tsx
#
RQ Mobile (JSON)rqmobile/tokens.json
or rqmobile/tokens-accessibility.json