|
1 | 1 | --- |
2 | | -description: Map Figma design tokens to existing theme tokens in app.css with confidence scores and suggestions. |
| 2 | +description: Match design tokens to existing theme tokens in app.css with confidence scores and suggestions. |
3 | 3 | --- |
4 | 4 |
|
5 | | -# storefront_next_map_tokens_to_theme |
| 5 | +# sfnext_match_tokens_to_theme |
6 | 6 |
|
7 | | -Maps Figma design tokens (colors, spacing, radius, etc.) to your Storefront Next theme tokens in `app.css`. Helps you identify which Figma tokens match existing theme variables and suggests new token names for values that don't have matches. |
| 7 | +Matches design tokens (colors, spacing, radius, etc.) to your Storefront Next theme tokens in `app.css`. Helps you identify which design tokens match existing theme variables and suggests new token names for values that don't have matches. |
8 | 8 |
|
9 | 9 | > **Note:** 🚧 This MCP tool is for Storefront Next. Storefront Next is part of a closed pilot and isn't available for general use. |
10 | 10 |
|
11 | 11 | ## Overview |
12 | 12 |
|
13 | | -The `storefront_next_map_tokens_to_theme` tool helps you use theme tokens instead of hardcoded values in your components. After retrieving design tokens from Figma, use this tool to map them to your Storefront Next theme. |
| 13 | +The `sfnext_match_tokens_to_theme` tool helps you use theme tokens instead of hardcoded values in your components. After retrieving design tokens (from Figma, design handoff, or other sources), use this tool to match them against your Storefront Next theme. |
14 | 14 |
|
15 | | -The tool reads your `app.css` theme file (or you can specify a custom path) and compares Figma tokens against your existing theme variables. It returns a report with instructions showing which tokens match, which are similar, and which need new theme variables created. **The tool does not modify files**—it provides recommendations and instructions for you to apply. |
| 15 | +The tool reads your `app.css` theme file (or you can specify a custom path) and compares design tokens against your existing theme variables. It returns a report with instructions showing which tokens match, which are similar, and which need new theme variables created. **The tool does not modify files**—it provides recommendations and instructions for you to apply. |
16 | 16 |
|
17 | 17 | This tool is part of the STOREFRONTNEXT toolset. |
18 | 18 |
|
19 | 19 | ## Prerequisites |
20 | 20 |
|
21 | 21 | - Storefront Next project with `app.css` (or provide `themeFilePath` explicitly) |
22 | | -- Figma tokens extracted from design (colors, spacing, radius, etc.) |
| 22 | +- Design tokens extracted (from Figma, design system, or other sources) |
23 | 23 |
|
24 | 24 | See [Figma-to-Component Tools Setup](../figma-tools-setup) for complete prerequisites and configuration. |
25 | 25 |
|
26 | 26 | ## Parameters |
27 | 27 |
|
28 | 28 | | Parameter | Type | Required | Description | |
29 | 29 | |-----------|------|----------|-------------| |
30 | | -| `figmaTokens` | array | Yes | Array of design tokens extracted from Figma. | |
| 30 | +| `figmaTokens` | array | Yes | Array of design tokens (e.g., from Figma, design system, or style guide). | |
31 | 31 | | `themeFilePath` | string | No | Optional absolute path to theme CSS file. If not provided, searches for `app.css` in common locations. | |
32 | 32 |
|
33 | | -### Figma Token Schema |
| 33 | +### Token Schema |
34 | 34 |
|
35 | 35 | Each token in `figmaTokens` must have: |
36 | 36 |
|
37 | 37 | | Field | Type | Required | Description | |
38 | 38 | |-------|------|----------|-------------| |
39 | | -| `name` | string | Yes | Token name from Figma (e.g., `"Primary/Blue"`, `"Spacing/Large"`). | |
| 39 | +| `name` | string | Yes | Token name (e.g., `"Primary/Blue"`, `"Spacing/Large"`). | |
40 | 40 | | `value` | string | Yes | Token value (e.g., `"#2563eb"`, `"16px"`, `"0.5rem"`). | |
41 | 41 | | `type` | string | Yes | One of: `color`, `spacing`, `radius`, `opacity`, `fontSize`, `fontFamily`, `other`. | |
42 | | -| `description` | string | No | Optional description from Figma. | |
43 | | - |
44 | | - |
45 | | -## Output |
46 | | - |
47 | | -Returns a report (does not modify files) showing: |
48 | | -- Which Figma tokens match existing theme variables (exact matches) |
49 | | -- Which tokens are similar to existing variables (suggested matches) |
50 | | -- Which tokens need new theme variables created (with suggested names) |
51 | | -- Instructions for using the matched tokens in components and adding new tokens to your theme file |
| 42 | +| `description` | string | No | Optional description. | |
52 | 43 |
|
53 | 44 | ## Usage Examples |
54 | 45 |
|
55 | | -**Map Figma tokens to your theme:** |
| 46 | +**Match design tokens to your theme (default app.css):** |
56 | 47 | ``` |
57 | | -Use the MCP tool to map these Figma tokens to my theme: Primary/Blue #2563eb (color), Spacing/Large 16px (spacing). |
| 48 | +Use the MCP tool to match these design tokens to my theme: Primary/Blue #2563eb (color), Spacing/Large 16px (spacing). |
58 | 49 | ``` |
59 | 50 |
|
60 | | -**With custom theme file path:** |
| 51 | +**Match design tokens with custom theme file path:** |
61 | 52 | ``` |
62 | | -Use the MCP tool to map Figma design tokens to my theme file at /path/to/app.css. |
| 53 | +Use the MCP tool to match these design tokens to my theme at /path/to/app.css: |
| 54 | +- Primary/Blue #2563eb (color) |
| 55 | +- Spacing/Large 16px (spacing) |
63 | 56 | ``` |
64 | 57 |
|
| 58 | +## Output |
| 59 | + |
| 60 | +Returns a report (does not modify files) showing: |
| 61 | +- Which design tokens match existing theme variables (exact matches) |
| 62 | +- Which tokens are similar to existing variables (suggested matches) |
| 63 | +- Which tokens need new theme variables created (with suggested names) |
| 64 | +- Instructions for using the matched tokens in components and adding new tokens to your theme file |
65 | 65 |
|
66 | 66 | ## Related Tools |
67 | 67 |
|
68 | | -- [`storefront_next_figma_to_component_workflow`](./storefront-next-figma-to-component-workflow) - Workflow orchestrator; call first |
69 | | -- [`storefront_next_generate_component`](./storefront-next-generate-component) - REUSE/EXTEND/CREATE recommendation |
| 68 | +- [`sfnext_start_figma_workflow`](./sfnext-start-figma-workflow) - Workflow orchestrator; call first |
| 69 | +- [`sfnext_analyze_component`](./sfnext-analyze-component) - REUSE/EXTEND/CREATE recommendation |
70 | 70 | - Part of the [STOREFRONTNEXT](../toolsets#storefrontnext) toolset |
71 | 71 | - Auto-enabled for Storefront Next projects |
72 | 72 |
|
|
0 commit comments