跳到正文
cccskills
免费在 GitHub 公开

figma-token-sync

Sync processed CSS design tokens with JavaScript theme objects for React Native. Use when aligning tokens after Figma sync, checking token consistency, or updating JS theme files manually.

中文简介正在准备中。当前显示原文说明。

集成工具Figma
查看安装方法

包含的文件(3)

  • SKILL.md3.0 KB
  • scripts/compare-tokens.sh1.7 KB
  • scripts/discover-themes.sh1.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Figma Token Sync

Keep the processed CSS tokens (from ETL) aligned with the JavaScript theme objects used for React Native.

Pipeline: Figma → JSON → CSS/Tailwind (automated) → JS themes (manual sync). CSS is the source of truth; the JS theme.dark.ts / theme.light.ts files are the sync targets.

Never hardcode the brand/theme list

Brands come and go (today: enterprise, ledger-live, websites — but discover, don't assume). Always enumerate them from the filesystem so a new brand can't be silently missed:

bash .claude/skills/figma-token-sync/scripts/discover-themes.sh

This prints the CSS brands, the JS brands, every JS theme file that must be updated together, and warns if the two sides disagree.

Gap analysis

For a brand + category, compare CSS coverage against JS and list the token names present in CSS but missing from JS:

bash .claude/skills/figma-token-sync/scripts/compare-tokens.sh <brand> <category>
# e.g. compare-tokens.sh ledger-live background

Run it for each category you touched (background, border, text, …) across every brand from the discovery step.

Applying updates

  • Update every JS theme file the discovery script listed — never just one. Partial updates create per-brand inconsistencies.
  • Reference primitives, never hardcode values, and use the correct light/dark primitive set:
// CSS is kebab-case, JS is camelCase
'--color-border-base-inverted'        → baseInverted
'--color-background-surface-disabled' → surfaceDisabled

// ✅ reference the primitive
baseInverted: primitiveColorTokens.dark.grey['050']
// ❌ never hardcode
baseInverted: '#ffffff'

Validate

npx tsc --noEmit --project libs/design-core/tsconfig.json
npx nx lint @ledgerhq/lumen-design-core --fix
npx nx build @ledgerhq/lumen-design-core

If you touched the ETL rather than the themes, it lives in internals/sync-figma — see its README.md.

Checklist:

  • Every JS theme file from discover-themes.sh was updated (no partial sync)
  • compare-tokens.sh shows no CSS-only tokens for the categories you touched
  • New tokens follow the CSS kebab → JS camelCase convention
  • All values reference primitives (no hardcoded hex)
  • typecheck, lint and build pass

Troubleshooting

  • Counts differ: rerun compare-tokens.sh to see which token names are CSS-only.
  • Type errors: the new token must match the TypeScript theme interface.
  • A brand looks stale: rerun discover-themes.sh — it may be new since the last sync, or present on only one side (it warns about that).

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Creates and maintains Figma Code Connect files (`*.figma.tsx`) that map Figma components to code via the parser-based `figma.connect()` API. Use when the user mentions Code Connect, Figma component mapping, design-to-code translation, or asks to create/update .figma.tsx files.

中文简介正在准备中。当前显示原文说明。

LedgerHQ/lumen232026年10月17日 更新

Use when creating, naming, or placing a file or folder in libs/*, or when modifying or adding a file to an existing component (even when the barrel isn't touched) — component vs utility naming, the one-responsibility-per-file layout, when a folder needs an `index.ts` barrel (public API only), and the required set of files a component needs per lib. Load this before scaffolding or restructuring a component so the layout matches the codebase.

中文简介正在准备中。当前显示原文说明。

LedgerHQ/lumen232026年10月17日 更新

Use when designing or changing a component's public API, its composition, or its state model in libs/ui-react or libs/ui-rnative — layering (core vs internal vs primitives), BaseProps/Props splits, converting a component to compound / changing its composition with createSafeContext, controlled/uncontrolled state, prop-naming conventions, and cross-platform API parity. Load this before shaping a new component, changing its props, or refactoring its composition.

中文简介正在准备中。当前显示原文说明。

LedgerHQ/lumen232026年10月17日 更新

Use when writing or editing Storybook MDX docs (*.mdx) — the two-tab Overview/Implementation structure, story-backed `<Source>` examples, and doc table guidelines.

中文简介正在准备中。当前显示原文说明。

LedgerHQ/lumen232026年10月17日 更新

Use when creating or editing Storybook stories (*.stories.tsx, React or React Native) — story layout, controls, and export naming conventions.

中文简介正在准备中。当前显示原文说明。

LedgerHQ/lumen232026年10月17日 更新

Use when building or styling a component in libs/ui-react or libs/ui-rnative — the cross-platform styling principles, plus routing to the platform mechanics: Tailwind + cva + cn on web, useStyleSheet + themeJS + lx on React Native. Load this before writing component styles.

中文简介正在准备中。当前显示原文说明。

LedgerHQ/lumen232026年10月17日 更新

查看 LedgerHQ 的全部技能

报告此技能的问题