Socket
Socket
Sign inDemoInstall

@invisible/design-system-tokens

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@invisible/design-system-tokens

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


Version published
Weekly downloads
129
increased by122.41%
Maintainers
0
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 28 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc