@invisible/design-system-tokens
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

design-system-tokens

This repository contains the MUI theme object derived from Figma design tokens from Invisible's Design team.

Tokens

Simply copy paste the Figma tokens generated by tokens-studio into scripts/tokens/tokens.json.

CLI Commands

// install dependencies
pnpm i

// generate the theme object
pnpm generate-mui

// build
pnpm build

Project structure

Scripts

main.ts

The main script is used to generate the mui-theme that will be consumed by createTheme from @mui/material/styles.

config.json

Use this config file to configure the files you want to generate and the associated Style Dictionary format.

mui-theme

This folder contains the generated folder which contains generated code from the scripts.

The theme.ts file has the MUI theme object exported.

Each top level key in the theme object is separated for simplicity and separation of concerns. Currently, only typography is in the theme object due to the format of tokens.json, but we can easily add more in the future by registering a format in main.ts and updating config.json.

Concepts

For those who don't know what Style Dictionary this, the following is a quick overview of some of the concepts that you will find useful to browse this repo.

Config

config.json defines where to find the design tokens, where to output generated files, and the associated transform.

Config docs

Transforms

Transforms are functions that modify a token so that it can be understood by a specific platform.

You can define custom transforms with the registerTransform

Transforms docs

Transform Group

Transform Groups are a way to easily use multiple transforms at once. They are an array of transforms. You can define a custom transform group with the registerTransformGroup.

Transform Group docs

Further reading

Style Dictionary Docs

Readme

Keywords

none

Package Sidebar

Install

npm i @invisible/design-system-tokens

Weekly Downloads

63

Version

1.1.2

License

ISC

Unpacked Size

371 kB

Total Files

35

Last publish

Collaborators

  • brittonware
  • juliendemarque
  • chancellorrr
  • adamhaney-invisible
  • nadeeminv
  • gtaltemann
  • elseagle
  • invisible-bot
  • rodrigo4244
  • scottdownes
  • zacksingh
  • el5091