Skip to content

Latest commit

 

History

History
104 lines (96 loc) · 3.57 KB

README.md

File metadata and controls

104 lines (96 loc) · 3.57 KB

Design tokens subcommand

cargo run -- design-tokens < example-figma-files/design-tokens-for-figma.json

A design tokens generator inspired by the legacy output of the design-tokens Figma plugin.

The sub command is not recommended for use as it is missing large amounts of functionality when compared to the plugin.

Compare the goal output with the sub command's output:

# vscode
code --diff src/design_tokens/{design-tokens-goal.tokens.json,example-output.json}

# jq and diff
diff -y --color=always <(jq --sort-keys < src/design_tokens/design-tokens-goal.tokens.json) <(jq --sort-keys < src/design_tokens/example-output.json) | less -R

# jq and diff focussing on a particular type
diff -y --color=always <(jq --sort-keys .motion < src/design_tokens/design-tokens-goal.tokens.json) <(jq --sort-keys .motion < src/design_tokens/example-output.json) | less -R
FeatureProblems
General
  • Numbers are often expressed with decimals. Not a problem but shows in the diff.
  • Sort order of properties are sometimes different. Not a problem but shows in the diff unless --sort-keys is used.
Sizes No known issues
Breakpoints No known issues
Spacing No known issues
Borders
  • Dash pattern isn't outputted (not present in the Figma API).
  • Ignores unsupported example (but is this a problem?)
Radii Smoothing isn't outputted (not present in the Figma API).
Motions
  • Direction properties aren't outputted.
  • .type.value is hardcoded and often incorrect.
  • custom-spring and custom-cubic-bezier values are hardcoded and often incorrect (not present in the Figma API).
  • Ignores instant example (but is this a problem?)
Opacities No known issues
Gradients Tokens are categorised as colors instead of gradients.
Colors
  • Incorrectly contains gradient tokens.
  • Color values aren't outputted (not present in the Figma API)!
Grid
  • Doesn't ignore invalid no-grid example.
  • Grid values aren't outputted (not present in the Figma API)!
Font Grid values aren't outputted (not present in the Figma API)!
Effect
  • Doesn't ignore invalid none example.
  • Effect values aren't outputted (not present in the Figma API)!