emulsify-ds / emulsify-ui-kit

Components connected to Figma using Design Tokens.
https://emulsify-ds.github.io/emulsify-ui-kit/
GNU General Public License v2.0
12 stars 6 forks source link

Customize figma-token-engine's rendering of design tokens #82

Closed amazingrando closed 1 year ago

amazingrando commented 1 year ago

The issue—customizing figma-token-engine's rendering of design tokens

Prior to the installation of the figma-token-engine package the only way to get design tokens from Figma was for a designer to push them from Figma. This package allows us to pull design tokens directly from Figma using their API. Once the tokens are pulled we then transform them into CSS and JSON.

The problem is that we need to modify the default output from figma-token-engine to get the tokens correct. We need to convert pixels values to rems for the sizing, spacing, borderRadius, breakpoint, and fontSize tokens. We also need to append "px" to the end of the borderWidth tokens. You can see these transformations in ./src/tokens/tokensTransform.js.

Additional Context

Using figma-token-engine

Rendering tokens without figma-token-engine

Desired outcome

I want to be able to use figma-token-engine to pull and transform design tokens from Figma so that developers do not have to wait on designers to export tokens.