Extract design tokens (colors, spacing, typography) from a Figma JSON export and emit them as CSS custom properties grouped by category.
Parses a Figma file's variables export (or a styles export) and produces a CSS custom-properties file with tokens grouped by category: color, spacing, typography, radius, shadow.
figma_export: path to a JSON file containing variables and/or styles from the Figma API (GET /v1/files/<key>/variables/local or GET /v1/files/<key>/styles).out_path: defaults to tokens.css.prefix: CSS variable prefix (default --).scope: collection name to scope to (e.g., Brand).variables or styles key. Abort otherwise.variables.meta.variables. Each variable has id, name, resolvedType, valuesByMode.styles if present (older files): FILL, TEXT, EFFECT, GRID types.COLOR -> color, FLOAT named like space* or padding* -> spacing, FLOAT named radius* -> radius, STRING named like font* -> typography token.path/to/Token -> --path-to-token rule.Math.round(value * 255).toString(16).padStart(2, '0').:root { ... } block; emit a comment header per group.[data-theme="dark"] { ... } block per non-default mode with overrides only for changed tokens.out_path.tokens.css containing :root { --... } blocks per category and per-mode overrides. Stdout prints the count of tokens per category and any tokens whose category was inferred (not explicitly tagged).
Open the produced file and confirm every group's variable names are valid CSS identifiers (regex [a-zA-Z][a-zA-Z0-9-]*). Validate with npx stylelint tokens.css --no-config. Re-import the CSS into a sandbox HTML and confirm browsers compute the expected colors via getComputedStyle(document.documentElement).getPropertyValue('--<name>'). If the Figma export contains alias references that resolve to other variables, ensure the emitted CSS preserves the alias (using var(--other)).
mode-1).Other publishers' experience with this skill. Self-rating is blocked.
Sign in and publish to the registry to leave a rating.
No ratings yet. Be the first.
Same domains or capabilities as amitte/figma-token-extractor.
Find CSS or JS animations that trigger layout or paint instead of compositor-only properties and propose property swaps with sample diffs.
Read a Lighthouse or CrUX report and narrate LCP, CLS, and INP scores into a prioritized fix plan with concrete code suggestions.
Tighten a Content-Security-Policy by stripping wildcards and verifying the result against actual page resource loads observed in browser logs.
Identify unused CSS classes via PurgeCSS and propose a configuration that's safe in the presence of dynamically constructed class names.
Audit a Tailwind config for color contrast in dark mode and flag every text-on-background pair below WCAG AA thresholds.
Walk a React component tree and identify subtrees not covered by an Error Boundary, suggesting placement points for new boundaries.