This page explains how to map Figma variables (the exported tokens) to Sitecopilot theme keys and the Tailwind config structure used by our templates.Documentation Index
Fetch the complete documentation index at: https://docs.sitecopilot.ai/llms.txt
Use this file to discover all available pages before exploring further.
Purpose
Figma tokens names rarely match your runtime CSS variable names or Tailwind keys. A mapping step aligns the exported JSON tokens with the keys expected bytailwind.config.js and the Sitecopilot template engine.
Example token snippet (from design-tokens plugin)
Mapping file (example)
Create a simple mapping JSON that maps Figma token paths to Tailwind theme keys:How to apply the mapping
- After exporting
tokens.json, run a small script (node/python) that reads the mapping, transforms token names, and outputs a normalized token JSON consumed by thegenerate_tailwindconfigtool. - Regenerate
tailwind.config.jsand inspect the generator report for unresolved names. - Iterate: fix Figma variable names if necessary or update the mapping file.
Recommendations
- Use consistent, kebab-case or dot.notation naming in Figma to simplify mapping.
- Keep the mapping file in the theme repo (
/themes/<theme-name>/mapping.json) so designers & developers can collaborate. - Validate the final
tailwind.config.jsby runningnpx tailwindcss -i ./src/input.css -o ./dist/output.css --minifyin a local build.