Repository navigation
Troubleshooting
Every message below is what the tool prints. <file> and <dir> stand for absolute paths.
None of the config names listed in CLI (figma-tokens.config.yaml, .yml, .json, or .figma-tokensrc and its variants) is in the folder you ran the command from. Parent folders are not searched. cd to the right folder, or pass --config <file> (CLI).
The file you gave to --config does not exist. The path is resolved against the current directory.
The config has no such option (Configuration).
Configs are data. Write the same options as YAML or JSON (Configuration).
The config cannot be parsed. <reason> is the parser's message, with the position.
A YAML config must be key: value pairs at the top level, not a list and not empty.
The config has an option the tool does not know, usually a typo. The message lists the valid names, and Configuration explains each one.
input points at a folder that does not exist. It is resolved against the folder of the config file, not against where you ran the command.
The folder exists but has no file ending in .json directly inside it. Subfolders are not read.
The file cannot be parsed. <reason> is the parser's message, with the position. Re-export it, or fix the file.
Printed under Reference Errors:. A token's value points at a token that does not exist. Both names are written after the collections were renamed, so Colors shows as color. Check the spelling and the case of the reference, and that the target is in one of the exported files.
figma-tokens: {Shadow.C} has a shadow value, which is not supported (supported: colors, numbers, strings, durations)
A token's $value is an object other than a duration. Composite tokens are rejected instead of producing a wrong variable. Remove the token from the export, or split it into numbers and colours.
A flag the command does not know. The options are in CLI.
--config was the last argument.
The tool did not find the semantic colours. Check, in this order:
- The colour collection must end up in the namespace
color.Colorsdoes by default; a collection with another name (Palette) needscollections: { Palette: "color" }. Look attokens.css: if the names start with--palette-instead of--color-, this is the cause. - The group names must match
semantic.group,semantic.lightandsemantic.dark(any case). - The colours must be under that group, below the colour collection.
Without semantic colours, tailwind.css has only section 1 (Tailwind-Output).
Only radius, size, sizes and text get px. Add the namespace: px: ["spacing"].
Check that tailwind.css has --transition-duration-primary. It is generated for every duration token, so if it is missing, the token is not in a collection that maps to duration.
The alias is not in aliases, or its target does not exist. The target is not checked: look for --color-primary: var(--color-…) in the last block of tailwind.css and make sure the target name appears above it.
- The class (or attribute) must be on an ancestor, and must match
darkSelector(default: classdark). - A colour with no dark value is left as it is, with a comment in the
.darkblock: search the file forno dark token. -
dark:prefixes followprefers-color-schemeunless you add the@custom-variantfrom Tailwind-Output.
--check compares the text exactly. Commit the generated files after running the command, and commit your lockfile so that CI installs the same style-dictionary and culori as you do.
Two tokens produced the same name (MdLarge and Md Large are both md-large). Rename one in Figma. In CSS, the last one wins.