Skip to content

keys

Key name transformation strategy. Any value produces a correct spec, just with differently formatted keys.

Fileconfig/settings.yaml
Pathspec.keys
Typeenum
DefaultCAMEL

Options

ValueDescription
CAMELcamelCase. Default — the casing every code consumer of a spec already uses
SAFEPreserve structure without corrupting special characters, at the cost of keys code cannot address directly
SNAKEsnake_case
KEBABkebab-case
PASCALPascalCase
TRAINTrain-Case

Comparison

Input: Background color or background-color

FormatResult
SAFEBackground color (preserved)
CAMELbackgroundColor
SNAKEbackground_color
KEBABbackground-color
PASCALBackgroundColor
TRAINBackground-Color

Example

spec:
keys: SAFE # Preserve Figma names instead

Transformation losses

Every value other than SAFE is a lossy projection of the Figma name — including the default, CAMEL. Names that cannot be reconstructed from the formatted key are preserved in $extensions.com.figma.name on the definition, so the spec stays reversible into Figma.

The projection is lossy in one way that bites downstream: a word boundary before a digit does not survive CAMEL. Brightness 1 becomes brightness1 — and nothing can tell afterwards that it was ever two words, because camelCase has no way to mark a boundary in front of a digit.

Anything that later derives a name from the key inherits that loss. The worked example is icon glyphs: the asset file on disk is named from the same rule, so every derivation — fetch, emitted code, the Icons page — lands on brightness1.svg, with no hyphen a human might expect. The derivations agree with each other by design; what they agree on is the post-transformation name, not the Figma one.

Changing spec.keys on an existing workspace changes every key in the spec and every name derived from one. Treat it as a migration: regenerate, re-emit, and expect diffs everywhere — there is no compatibility layer that maps old keys to new ones.

The exact value is also enforced: an unrecognized value (including a case variant like camel) is not silently corrected. The run warns, names the valid values, and uses the default.

Further reading

  • Figma Keys for the convention your Figma file uses, and the target keys reverse into.
  • Key Formatting guide for detailed formatting behavior and edge cases.