Skip to content

chore: handle spaces, dashes and underscores in token names - #420

Merged
gorandalum merged 1 commit into
mainfrom
dalum/tolerate_dash_and_space_in_figma_variables
Oct 9, 2026
Merged

gorandalum merged 1 commit into
mainfrom
dalum/tolerate_dash_and_space_in_figma_variables

Conversation

@gorandalum

@gorandalum gorandalum commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Figma variables named with separators (e.g. "strong--highlight") were
emitted as unquoted object keys in the generated TypeScript themes,
producing invalid syntax and failing the update-design-tokens workflow.

convertToCamelCase now treats spaces, dashes and underscores as word
separators, so "Strong Highlight", "strong-highlight", "strong--highlight"
and "strong_highlight" all become "strongHighlight" (CSS variables remain
kebab-case). Existing token names are unaffected.

@gorandalum gorandalum self-assigned this Oct 9, 2026
Figma variables named with separators (e.g. "strong--highlight") were
emitted as unquoted object keys in the generated TypeScript themes,
producing invalid syntax and failing the update-design-tokens workflow.

convertToCamelCase now treats spaces, dashes and underscores as word
separators, so "Strong Highlight", "strong-highlight", "strong--highlight"
and "strong_highlight" all become "strongHighlight" (CSS variables remain
kebab-case). Existing token names are unaffected.
@gorandalum
gorandalum force-pushed the dalum/tolerate_dash_and_space_in_figma_variables branch from 38e6ec8 to ba1b3a6 Compare October 9, 2026 10:58
@gorandalum gorandalum changed the title dalum/tolerate dash and space in figma variables chore: handle spaces, dashes and underscores in token names Oct 9, 2026
@gorandalum
gorandalum requested review from pettersuul and reidzeibel and a balanced review from Copilot October 9, 2026 10:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused conversion change correctly handles the documented separator variants without altering separator-free names.

0 open findings

What changed in this PR

Updates token-name normalization so generated TypeScript object keys remain valid when Figma names contain common separators.

Changes:

  • Treats spaces, dashes, and underscores as camel-case separators.
  • Documents expected conversions.
File Description
packages/​theme/​tools/​utils.ts Enhances camel-case conversion for token names.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@gorandalum
gorandalum merged commit bde1253 into main Oct 9, 2026
3 checks passed
@gorandalum
gorandalum deleted the dalum/tolerate_dash_and_space_in_figma_variables branch October 9, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants