igniteui-webcomponents 7.4.0 → 7.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/components/checkbox/checkbox-base.d.ts +2 -0
- package/components/checkbox/checkbox-base.js +4 -0
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.js +3 -11
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.js +1 -8
- package/components/checkbox/switch.js.map +1 -1
- package/components/color-picker/color-picker.js +3 -3
- package/components/color-picker/color-picker.js.map +1 -1
- package/components/combo/combo.d.ts +6 -4
- package/components/combo/combo.js +13 -24
- package/components/combo/combo.js.map +1 -1
- package/components/date-picker/date-picker.base.d.ts +3 -3
- package/components/date-picker/date-picker.base.js +2 -2
- package/components/date-picker/date-picker.base.js.map +1 -1
- package/components/date-picker/date-picker.d.ts +1 -1
- package/components/date-range-picker/date-range-picker.d.ts +1 -1
- package/components/date-time-input/date-time-input.base.d.ts +4 -4
- package/components/date-time-input/date-time-input.base.js +3 -5
- package/components/date-time-input/date-time-input.base.js.map +1 -1
- package/components/file-input/file-input.d.ts +5 -0
- package/components/file-input/file-input.js +4 -0
- package/components/file-input/file-input.js.map +1 -1
- package/components/input/input-base.d.ts +2 -2
- package/components/input/input-base.js +3 -5
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +1 -1
- package/components/radio/radio.d.ts +2 -0
- package/components/radio/radio.js +7 -11
- package/components/radio/radio.js.map +1 -1
- package/components/rating/rating.d.ts +3 -0
- package/components/rating/rating.js +17 -18
- package/components/rating/rating.js.map +1 -1
- package/components/select/select.js +1 -1
- package/components/select/select.js.map +1 -1
- package/components/slider/range-slider.d.ts +0 -1
- package/components/slider/range-slider.js +6 -11
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/slider-base.d.ts +4 -1
- package/components/slider/slider-base.js +20 -18
- package/components/slider/slider-base.js.map +1 -1
- package/components/slider/slider.d.ts +2 -0
- package/components/slider/slider.js +5 -1
- package/components/slider/slider.js.map +1 -1
- package/components/textarea/textarea.d.ts +1 -4
- package/components/textarea/textarea.js +3 -5
- package/components/textarea/textarea.js.map +1 -1
- package/components/validation-container/validation-container.js +2 -1
- package/components/validation-container/validation-container.js.map +1 -1
- package/components/virtualization/engine.d.ts +35 -4
- package/components/virtualization/engine.js +126 -61
- package/components/virtualization/engine.js.map +1 -1
- package/components/virtualization/recycle.d.ts +13 -0
- package/components/virtualization/recycle.js +152 -0
- package/components/virtualization/recycle.js.map +1 -0
- package/components/virtualization/virtualization.d.ts +32 -11
- package/components/virtualization/virtualization.js +14 -11
- package/components/virtualization/virtualization.js.map +1 -1
- package/custom-elements.json +2382 -79
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/internals/controllers/aria-projection.d.ts +61 -23
- package/internals/controllers/aria-projection.js +77 -26
- package/internals/controllers/aria-projection.js.map +1 -1
- package/internals/mixins/forms/associated.js +34 -0
- package/internals/mixins/forms/associated.js.map +1 -1
- package/internals/mixins/forms/types.d.ts +5 -0
- package/internals/mixins/forms/types.js.map +1 -1
- package/internals/templates/toggle-shell.d.ts +15 -14
- package/internals/templates/toggle-shell.js +12 -8
- package/internals/templates/toggle-shell.js.map +1 -1
- package/internals/utils/dom.d.ts +2 -2
- package/internals/utils/dom.js +2 -2
- package/internals/utils/dom.js.map +1 -1
- package/package.json +1 -1
- package/skills/README.md +2 -4
- package/skills/igniteui-wc-choose-components/SKILL.md +2 -1
- package/skills/igniteui-wc-customize-component-theme/SKILL.md +2 -1
- package/skills/igniteui-wc-figma-to-app/SKILL.md +133 -712
- package/skills/igniteui-wc-figma-to-app/references/asset-extraction.md +42 -62
- package/skills/igniteui-wc-figma-to-app/references/design-provenance.md +199 -0
- package/skills/igniteui-wc-figma-to-app/references/design-token-bridge.md +189 -107
- package/skills/igniteui-wc-figma-to-app/references/figma-component-map.md +129 -84
- package/skills/igniteui-wc-figma-to-app/references/figma-exploration.md +222 -0
- package/skills/igniteui-wc-figma-to-app/references/mcp-setup.md +81 -127
- package/skills/igniteui-wc-figma-to-app/references/project-setup.md +105 -0
- package/skills/igniteui-wc-figma-to-app/references/theme-generation.md +180 -0
- package/skills/igniteui-wc-figma-to-app/references/validation-patterns.md +74 -80
- package/skills/igniteui-wc-generate-from-image-design/SKILL.md +2 -1
- package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +3 -3
- package/skills/igniteui-wc-grids/SKILL.md +133 -0
- package/skills/igniteui-wc-integrate-with-framework/SKILL.md +2 -1
- package/skills/igniteui-wc-migrate-grid-lite-to-premium/SKILL.md +2 -1
- package/skills/igniteui-wc-optimize-bundle-size/SKILL.md +2 -1
- package/web-types.json +1 -1
|
@@ -1,411 +1,110 @@
|
|
|
1
1
|
---
|
|
2
|
+
license: MIT
|
|
2
3
|
name: igniteui-wc-figma-to-app
|
|
3
|
-
description:
|
|
4
|
+
description: "Builds Ignite UI Web Components views from Figma designs, supporting Indigo.Design kits, third-party kits (Material 3, Fluent 2, shadcn/ui, Untitled UI, in-house), and plain frames. Uses the Figma, Ignite UI CLI, Ignite UI Theming, and Playwright MCP servers. WHEN TO USE: implementing a Figma design, artboard, or Figma URL with Ignite UI Web Components, including inside React, Angular, or Vue apps. WHEN NOT TO USE: screenshots or mockups without a Figma file (use igniteui-wc-generate-from-image-design), component selection or theme-only changes (use igniteui-wc-choose-components or igniteui-wc-customize-component-theme), or the native Ignite UI for Angular or Blazor packages."
|
|
4
5
|
user-invocable: true
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Ignite UI for Web Components — Figma to App
|
|
8
9
|
|
|
9
|
-
Translate Figma app screens built with
|
|
10
|
-
Web Components applications. Designers create their own frames in Figma using the
|
|
11
|
-
Indigo.Design component libraries as shared libraries — these kits come in four
|
|
12
|
-
design-system variants (**Material**, **Fluent**, **Bootstrap**, **Indigo**) with light
|
|
13
|
-
and dark themes each. Every component instance in the design maps to an Ignite UI Web
|
|
14
|
-
Components control, and the active kit variant directly determines which design system
|
|
15
|
-
to configure in the app theme.
|
|
10
|
+
Translate Figma app screens into production Web Components applications built with Ignite UI. The skill accepts designs from three kinds of source. A single file often mixes them, so every component is classified individually (Phase 1f):
|
|
16
11
|
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
| Tier | Source | How it maps to Ignite UI |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| **A** | The Infragistics **Indigo.Design UI Kits** (Material, Fluent, Bootstrap, Indigo variants, light and dark) | Directly, by kit layer name. The kit variant *is* the Ignite UI design system. |
|
|
15
|
+
| **B** | Any other component library: public kits such as Material 3, Fluent 2, Bootstrap, shadcn/ui, Untitled UI, or Ant, and in-house design systems | Variant properties are normalized to a canonical role, then mapped. The theme is fitted to a closest baseline design system. |
|
|
16
|
+
| **C** | Plain frames, groups, and detached instances | The role is inferred from structure and visuals, with lower confidence, and the user confirms it. |
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
> `defineComponents(...)`, theming is **CSS-custom-property-first** (Sass optional),
|
|
23
|
-
> and every component renders in **shadow DOM** — which changes how you style and how
|
|
24
|
-
> you measure. These differences are called out in each phase.
|
|
18
|
+
Tier A gives the highest fidelity for the least effort. Tiers B and C reach high fidelity through token overrides, and record the remaining **anatomy deltas** (structural differences between the design's components and Ignite UI's) for the user to approve instead of hiding them.
|
|
19
|
+
|
|
20
|
+
> **Web Components ≠ Angular.** The kits are shared across frameworks, but the implementation is not: tags are `igc-*`, components must be registered with `defineComponents(...)`, theming is **CSS-custom-property-first** (Sass optional), and every component renders in **shadow DOM** — which changes how you style and how you measure. These differences are called out in each phase.
|
|
25
21
|
|
|
26
22
|
---
|
|
27
23
|
|
|
28
24
|
## Required Workflow
|
|
29
25
|
|
|
30
|
-
Complete all phases in order — do not skip phases or generate component code from
|
|
31
|
-
memory. Every tag name, attribute, slot, and import path must come from `get_doc` /
|
|
32
|
-
`get_api_reference` results, or from the reference files of the sibling
|
|
33
|
-
`igniteui-wc-choose-components` skill — never guessed.
|
|
26
|
+
Complete all phases in order — do not skip phases or generate component code from memory. Every tag name, attribute, slot, and import path must come from `get_doc` / `get_api_reference` results, or from the reference files of the sibling `igniteui-wc-choose-components` skill — never guessed.
|
|
34
27
|
|
|
35
|
-
Read [references/figma-component-map.md](references/figma-component-map.md) before Phase 2.
|
|
36
|
-
Read [references/design-token-bridge.md](references/design-token-bridge.md) before Phase 3.
|
|
37
|
-
Read [references/asset-extraction.md](references/asset-extraction.md) before Phase 1h.
|
|
38
|
-
Read [references/validation-patterns.md](references/validation-patterns.md) before Phase 5.
|
|
28
|
+
Read [references/project-setup.md](references/project-setup.md) before Phase 0b (and its layout section in Phase 4). Read [references/figma-exploration.md](references/figma-exploration.md) before Phase 1. Read [references/design-provenance.md](references/design-provenance.md) before Phase 1f. Read [references/asset-extraction.md](references/asset-extraction.md) before Phase 1h. Read [references/figma-component-map.md](references/figma-component-map.md) before Phase 2. Read [references/theme-generation.md](references/theme-generation.md) before Phase 3. Read [references/design-token-bridge.md](references/design-token-bridge.md) before Phase 3. Read [references/validation-patterns.md](references/validation-patterns.md) before Phase 5.
|
|
39
29
|
|
|
40
30
|
---
|
|
41
31
|
|
|
42
32
|
## Phase 0 — Prerequisites
|
|
43
33
|
|
|
44
|
-
> **Tool naming:** this skill writes MCP tool names as `<server>_<tool>` (e.g.
|
|
45
|
-
> `figma_get_metadata`, `theming_create_theme`). The exact name depends on the client —
|
|
46
|
-
> Claude Code exposes them as `mcp__<server>__<tool>` (e.g. `mcp__figma__get_metadata`).
|
|
47
|
-
> Match by the tool's base name on whatever server is connected.
|
|
34
|
+
> **Tool naming:** this skill writes MCP tool names as `<server>_<tool>` (e.g. `figma_get_metadata`, `theming_create_theme`). The exact name depends on the client — Claude Code exposes them as `mcp__<server>__<tool>` (e.g. `mcp__figma__get_metadata`). Match by the tool's base name on whatever server is connected.
|
|
48
35
|
|
|
49
36
|
### 0a: Verify All Four MCP Servers
|
|
50
37
|
|
|
51
|
-
Run these checks **silently** in parallel. Each verification call is a no-op if the
|
|
52
|
-
server is not connected; do not surface raw errors to the user at this point.
|
|
38
|
+
Run these checks **silently** in parallel. Each verification call is a no-op if the server is not connected; do not surface raw errors to the user at this point.
|
|
53
39
|
|
|
54
|
-
| Server | Verification call
|
|
55
|
-
| --------------------- |
|
|
56
|
-
| **Figma** |
|
|
57
|
-
| **Ignite UI CLI** | `list_components` with `framework: "webcomponents"`
|
|
58
|
-
| **Ignite UI Theming** | `theming_detect_platform`
|
|
59
|
-
| **Playwright** | `playwright_browser_navigate` to `about:blank`
|
|
40
|
+
| Server | Verification call | Success signal |
|
|
41
|
+
| --------------------- | --------------------------------------------------- | -------------------------------- |
|
|
42
|
+
| **Figma** | Inspect the Figma tools (no call — quotas are small) | Tools listed. The configured server URL (or `fileKey` in the tool schema) tells remote from desktop |
|
|
43
|
+
| **Ignite UI CLI** | `list_components` with `framework: "webcomponents"` | Returns component list |
|
|
44
|
+
| **Ignite UI Theming** | `theming_detect_platform` | Returns `webcomponents` platform |
|
|
45
|
+
| **Playwright** | `playwright_browser_navigate` to `about:blank` | Navigates without error |
|
|
60
46
|
|
|
61
|
-
If **any server fails**,
|
|
62
|
-
before continuing. For `igniteui-cli` and `igniteui-theming`, the fastest path is
|
|
63
|
-
`npx -y igniteui-cli ai-config`, which configures both. Full setup instructions for all
|
|
64
|
-
servers are in [references/mcp-setup.md](references/mcp-setup.md). Newly configured MCP
|
|
65
|
-
servers require an editor/session reload before their tools appear.
|
|
47
|
+
If **any server fails**, fix setup **for that server only** before continuing. For `igniteui-cli` and `igniteui-theming`, configure them yourself — run `npx -y igniteui-cli ai-config` (or `ig ai-config`) from the project root, which configures both. Add a missing Playwright entry yourself as well. The Figma servers need the user's action — the desktop server is enabled in the Figma desktop app, and the remote server signs in through Figma OAuth — so guide the user through the Figma setup. Full setup instructions for all servers are in [references/mcp-setup.md](references/mcp-setup.md). Newly configured MCP servers require an editor/session reload before their tools appear — ask the user to reload, then stop.
|
|
66
48
|
|
|
67
49
|
### 0b: Detect or Scaffold a Web Components Project
|
|
68
50
|
|
|
69
|
-
Check whether the
|
|
70
|
-
project:
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
1. Does package.json exist?
|
|
74
|
-
2. Does it list "igniteui-webcomponents" OR "@infragistics/igniteui-webcomponents" in dependencies?
|
|
75
|
-
3. Is there a src/ directory with an entry module (src/index.ts, src/main.ts, or similar)?
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**If a valid project is found:**
|
|
79
|
-
|
|
80
|
-
- Note the package layout: `igniteui-webcomponents` (open source / trial) or
|
|
81
|
-
`@infragistics/igniteui-webcomponents` (licensed). The same split applies to the
|
|
82
|
-
commercial packages — `igniteui-webcomponents-grids`, `igniteui-webcomponents-charts`,
|
|
83
|
-
`igniteui-webcomponents-core`, `igniteui-dockmanager`.
|
|
84
|
-
- Note the host setup: plain Lit/vanilla app, or a framework wrapper (React/Angular/Vue).
|
|
85
|
-
If a wrapper is in play, registration and event binding follow
|
|
86
|
-
[`igniteui-wc-integrate-with-framework`](../igniteui-wc-integrate-with-framework/SKILL.md),
|
|
87
|
-
not the raw `defineComponents` pattern.
|
|
88
|
-
- Note whether **Sass** is configured (a `.scss` entry file, `sass` in `devDependencies`,
|
|
89
|
-
or a bundler Sass plugin). This decides the Phase 3 output format — CSS or Sass.
|
|
90
|
-
- **Check the MCP configuration for all four required server entries** — `figma`,
|
|
91
|
-
`igniteui-cli`, `igniteui-theming`, and `playwright` (in `.vscode/mcp.json` or the
|
|
92
|
-
client's equivalent). If `igniteui-cli` or `igniteui-theming` is missing, run
|
|
93
|
-
`npx -y igniteui-cli ai-config` from the project root — it configures both servers and
|
|
94
|
-
copies the Agent Skills, preserving existing entries. Add missing `figma` and
|
|
95
|
-
`playwright` entries from [references/mcp-setup.md](references/mcp-setup.md).
|
|
96
|
-
Projects scaffolded with `npx igniteui-cli new` already have `igniteui-cli` **and**
|
|
97
|
-
`igniteui-theming` wired; they typically lack `figma` and `playwright`. A reload is
|
|
98
|
-
required before newly configured servers' tools appear.
|
|
99
|
-
- Inform the user: "Found existing Ignite UI Web Components project. Proceeding with the
|
|
100
|
-
Figma workflow."
|
|
101
|
-
|
|
102
|
-
**If no valid project is found:**
|
|
103
|
-
Present this message and wait for the user's choice:
|
|
104
|
-
|
|
105
|
-
> "No Ignite UI Web Components project found in the current directory. Would you like me
|
|
106
|
-
> to scaffold a new one using the Ignite UI CLI before implementing the Figma design?
|
|
107
|
-
>
|
|
108
|
-
> `npx -y igniteui-cli new` creates a Vite + Lit + TypeScript project pre-configured with
|
|
109
|
-
> `igniteui-webcomponents`, a theme already wired in `styles.css`, and the Ignite UI CLI
|
|
110
|
-
> and Theming MCP servers auto-wired into `.vscode/mcp.json`. No global install required.
|
|
111
|
-
>
|
|
112
|
-
> Alternatively, point me at an existing project directory."
|
|
113
|
-
|
|
114
|
-
If the user confirms scaffolding:
|
|
115
|
-
|
|
116
|
-
1. Ask for a project name. If the user has already shared a Figma URL, suggest a name
|
|
117
|
-
derived from the Figma file name; otherwise prompt.
|
|
118
|
-
|
|
119
|
-
2. Choose the project template based on the artboard structure. Because Phase 1 has not
|
|
120
|
-
run yet, use the lightest signal available:
|
|
121
|
-
|
|
122
|
-
| Signal | Template to use |
|
|
123
|
-
| -------------------------------------------------------------------- | ----------------------------------------------- |
|
|
124
|
-
| User mentions a persistent sidebar or multiple routed views | `side-nav` |
|
|
125
|
-
| User mentions an icon-rail / collapsible sidebar | `side-nav-mini` |
|
|
126
|
-
| No strong signal — default | `empty` (routing + home page; easiest to extend) |
|
|
127
|
-
|
|
128
|
-
3. Create the project:
|
|
129
|
-
|
|
130
|
-
```bash
|
|
131
|
-
npx -y igniteui-cli new <project-name> --framework=webcomponents --type=igc-ts --template=<empty|side-nav|side-nav-mini>
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
This produces a standard Vite workspace and additionally:
|
|
135
|
-
- Installs and configures `igniteui-webcomponents` and `lit`
|
|
136
|
-
- Wires `@vaadin/router` routing in `src/app/app-routing.ts`
|
|
137
|
-
- Generates `.vscode/mcp.json` with the `igniteui-cli` **and** `igniteui-theming`
|
|
138
|
-
MCP server entries already set
|
|
139
|
-
- Copies static assets from `src/assets` via `vite-plugin-static-copy`
|
|
51
|
+
Check whether the working directory contains a `package.json` that lists `igniteui-webcomponents`, and a `src/` entry module.
|
|
140
52
|
|
|
141
|
-
|
|
53
|
+
- **Project found:** note the package layout (`igniteui-webcomponents` is MIT; grids, charts, and dock manager come as trial or `@infragistics` licensed packages), the host setup (plain Lit/vanilla, or a React/Angular/Vue wrapper), and whether Sass is configured (it decides the Phase 3 output format). Confirm the MCP configuration has all four server entries.
|
|
54
|
+
- **No project found:** offer to scaffold one with `npx -y igniteui-cli new`, or to use an existing project directory, and wait for the user's choice.
|
|
142
55
|
|
|
143
|
-
|
|
144
|
-
server entries from `references/mcp-setup.md`. The `igniteui-cli` and
|
|
145
|
-
`igniteui-theming` entries are already present — do not duplicate them.
|
|
146
|
-
|
|
147
|
-
6. Confirm the project starts cleanly:
|
|
148
|
-
```bash
|
|
149
|
-
npm start # vite --open, default http://localhost:5173
|
|
150
|
-
```
|
|
151
|
-
Then continue to Phase 1.
|
|
152
|
-
|
|
153
|
-
### 0c: Determine Which Figma MCP Variant Is Connected
|
|
154
|
-
|
|
155
|
-
Two Figma MCP variants exist and they are driven differently. Establish which one you
|
|
156
|
-
have **before** Phase 1, because it decides whether you can navigate artboards yourself.
|
|
157
|
-
|
|
158
|
-
| Variant | Signal | How you drive it |
|
|
159
|
-
| --------------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
160
|
-
| **Remote / addressable** | `get_design_context` / `get_metadata` require `fileKey` + `nodeId` | Pass `fileKey` and `nodeId` explicitly. You can iterate artboards without the user. |
|
|
161
|
-
| **Desktop / session-bound** | Tools take no required params and act on the current selection | Ask the user to click each frame in Figma before every call. Any `nodeId` is ignored. |
|
|
162
|
-
|
|
163
|
-
Check the tool signature of `figma_get_metadata`. If `fileKey` is required, you have the
|
|
164
|
-
addressable variant — **prefer it**, and ask the user once for the file URL:
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
https://figma.com/design/:fileKey/:fileName?node-id=1-2 → fileKey = ":fileKey", nodeId = "1:2"
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
Every Figma call below shows the addressable form. When only the session-bound variant is
|
|
171
|
-
available, drop `fileKey`/`nodeId` and insert this step before each call:
|
|
172
|
-
|
|
173
|
-
> *"In Figma, please click the **[Artboard Name]** frame to select it, then confirm."*
|
|
174
|
-
|
|
175
|
-
Wait for confirmation before calling. Never batch session-bound calls.
|
|
56
|
+
Read [references/project-setup.md](references/project-setup.md) for the detection checklist, the exact messages to show the user, template selection, and the scaffolding steps.
|
|
176
57
|
|
|
177
58
|
---
|
|
178
59
|
|
|
179
60
|
## Phase 1 — Figma Design Exploration
|
|
180
61
|
|
|
181
|
-
**Goal:** understand the full design structure and capture all data needed for
|
|
182
|
-
implementation and validation before writing any code.
|
|
183
|
-
|
|
184
|
-
> **Rate-limit awareness:** Figma MCP calls count against plan quotas
|
|
185
|
-
> (indicative, subject to change — verify against the user's current Figma plan:
|
|
186
|
-
> Starter **6 calls/month**, Organization 200/day, Enterprise 600/day).
|
|
187
|
-
>
|
|
188
|
-
> Estimated call budget for a 5-artboard design:
|
|
189
|
-
> `figma_get_metadata` ×2 + `figma_get_screenshot` ×5 + `figma_get_design_context` ×5 + `figma_get_variable_defs` ×1 + `figma_get_code_connect_map` ×5 = **~18 calls**.
|
|
190
|
-
> **Starter plan users will exceed their monthly quota in a single session.** Strategies:
|
|
191
|
-
> 1. Call `figma_get_variable_defs` only **once** for the root page (variables are file-scoped, not artboard-scoped).
|
|
192
|
-
> 2. `figma_get_design_context` already returns a screenshot — do not also call
|
|
193
|
-
> `figma_get_screenshot` for the same node unless you need a larger `maxDimension`.
|
|
194
|
-
> 3. For large files, consider implementing one artboard per monthly budget cycle.
|
|
195
|
-
|
|
196
|
-
### 1a: Discover Pages and Artboards
|
|
197
|
-
|
|
198
|
-
Call `figma_get_metadata` with the `fileKey` and no `nodeId` — it returns the top-level
|
|
199
|
-
page list. Then call it again per relevant page (`nodeId` = page id, e.g. `0:1`) to get
|
|
200
|
-
the artboard tree with node IDs, names, positions, and sizes.
|
|
201
|
-
|
|
202
|
-
Record each target artboard's **width and height** — Phase 5 resizes the browser to them.
|
|
203
|
-
|
|
204
|
-
### 1b: Select Target Artboards
|
|
205
|
-
|
|
206
|
-
If there are multiple pages or artboards, show the user a list:
|
|
207
|
-
|
|
208
|
-
> "I found these artboards in your Figma file:
|
|
209
|
-
>
|
|
210
|
-
> - Page 1: [list artboard names + node IDs]
|
|
211
|
-
> - Page 2: [list artboard names + node IDs]
|
|
212
|
-
>
|
|
213
|
-
> Which artboards should I implement? (You can say 'all' or list specific names.)"
|
|
214
|
-
|
|
215
|
-
Wait for confirmation before proceeding.
|
|
216
|
-
|
|
217
|
-
### 1c: Capture Reference Screenshots
|
|
218
|
-
|
|
219
|
-
For each target artboard:
|
|
220
|
-
|
|
221
|
-
```
|
|
222
|
-
figma_get_screenshot({ fileKey: "<fileKey>", nodeId: "<artboardId>", maxDimension: 2048 })
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
The response returns a short-lived URL plus a `curl` command, and metadata with both the
|
|
226
|
-
rendered size and the node's natural size. **Download each screenshot to disk** (e.g.
|
|
227
|
-
`.figma-reference/<artboard-name>.png`) — the URL expires, and Phase 5 compares against
|
|
228
|
-
these files. Record `{ artboardName, nodeId, file, width, height }`.
|
|
229
|
-
|
|
230
|
-
After all artboards are captured, confirm the count:
|
|
231
|
-
> *"I have N reference screenshots: [list artboard names]. Proceeding to design context extraction."*
|
|
232
|
-
|
|
233
|
-
> Never skip this step. The screenshots are your ground truth for Phase 5 validation.
|
|
234
|
-
|
|
235
|
-
### 1d: Extract Design Context
|
|
236
|
-
|
|
237
|
-
> **Output format:** `figma_get_design_context` returns **React + Tailwind CSS reference
|
|
238
|
-
> code**, not structured Web Components metadata. Do **not** copy that code into the
|
|
239
|
-
> project. Read the JSX to extract the information below. Asset URLs in the response are
|
|
240
|
-
> short-lived — see Phase 1h and `references/asset-extraction.md`.
|
|
241
|
-
|
|
242
|
-
For **each** target artboard:
|
|
243
|
-
|
|
244
|
-
```
|
|
245
|
-
figma_get_design_context({
|
|
246
|
-
fileKey: "<fileKey>",
|
|
247
|
-
nodeId: "<artboardId>"
|
|
248
|
-
})
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
From the React+Tailwind output, extract:
|
|
252
|
-
|
|
253
|
-
- **Component layer names** (`data-name` attributes in the JSX) — match against
|
|
254
|
-
`references/figma-component-map.md`
|
|
255
|
-
- **Layout structure** — `flex`, `grid`, `gap-*`, `p-*`, `w-*`, `h-*` classes on containers
|
|
256
|
-
- **Typography** — `font-['...']`, `text-[...]`, weight classes
|
|
257
|
-
- **Surface colors** — `bg-[#XXXXXX]` on container `<div>` elements that wrap major
|
|
258
|
-
sections (these become plain `<div>` wrappers in the view, not Ignite UI components)
|
|
259
|
-
- **Border / roundness** — `rounded-[...]`, `border`, `border-[...]` on containers and cards
|
|
260
|
-
- **Input variant indicators** — hidden zero-size nodes (`size-[0.5px]`) whose `data-name`
|
|
261
|
-
contains a component type (e.g. `"Date Picker Type"`, `"Combo Input"`). These are the
|
|
262
|
-
Indigo.Design kit's **variant indicator nodes**; their name encodes which input variant
|
|
263
|
-
(border/line/box) is active. See the input-variant note in Phase 4 — Web Components
|
|
264
|
-
expose this as the boolean `outlined` attribute, not a three-way type.
|
|
265
|
-
- **Chart series colors** — for any chart layer, note the fill colors on its series paths
|
|
266
|
-
- **Action controls** — list every button, icon button, and toolbar action visible in the
|
|
267
|
-
artboard; this is your authoritative inventory — do not add actions not present in the design
|
|
268
|
-
- **Active kit variant** — look for library component references whose source file name
|
|
269
|
-
contains "Material", "Fluent", "Bootstrap", or "Indigo". If not found here, defer to
|
|
270
|
-
Phase 1e variable names and [references/design-token-bridge.md](references/design-token-bridge.md).
|
|
271
|
-
|
|
272
|
-
Record all surface containers in the **Surfaces Spec** (Table B in Phase 1g).
|
|
273
|
-
|
|
274
|
-
### 1e: Extract Design Tokens
|
|
275
|
-
|
|
276
|
-
> Figma variables are **file-scoped**, not artboard-scoped. Call once for the root page
|
|
277
|
-
> node — not once per artboard.
|
|
278
|
-
|
|
279
|
-
```
|
|
280
|
-
figma_get_variable_defs({ fileKey: "<fileKey>", nodeId: "<pageId>" })
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
The response maps variable names to values, e.g.:
|
|
284
|
-
|
|
285
|
-
```
|
|
286
|
-
"color/primary/500": "#6200EE"
|
|
287
|
-
"color/surface": "#FFFFFF"
|
|
288
|
-
"typography/body/font-family": "Roboto"
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
Use `references/design-token-bridge.md` to map color and typography variables to Ignite UI
|
|
292
|
-
theming inputs in Phase 3. Do **not** attempt to map Figma spacing or sizing values — see
|
|
293
|
-
`references/design-token-bridge.md § Spacing, Sizing, and Roundness` for why.
|
|
294
|
-
|
|
295
|
-
### 1f: Check for Existing Code Connect Mappings
|
|
296
|
-
|
|
297
|
-
```
|
|
298
|
-
figma_get_code_connect_map({ fileKey: "<fileKey>", nodeId: "<artboardId>" })
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
If mappings exist, they confirm which components correspond to which Figma nodes — use
|
|
302
|
-
them to validate or augment your Phase 2 component mapping.
|
|
303
|
-
|
|
304
|
-
### 1g: Build the Decomposition Table
|
|
305
|
-
|
|
306
|
-
Before writing any code, produce **two tables** for **each artboard**.
|
|
307
|
-
|
|
308
|
-
#### Table A — Ignite UI Components
|
|
62
|
+
**Goal:** understand the full design structure and capture all data needed for implementation and validation before writing any code.
|
|
309
63
|
|
|
310
|
-
|
|
311
|
-
| -------------------------- | ------------------ | -------------------------------------- | ------------------------ | ------------------- | --------------- |
|
|
312
|
-
| _e.g._ `_NavBar` | Top navigation bar | `<igc-navbar>` / `IgcNavbarComponent` | `igniteui-webcomponents` | `color/primary/500` | n/a |
|
|
313
|
-
| _e.g._ `_Grid/Default` | Data table | `<igc-grid>` / `IgcGridComponent` | `igniteui-webcomponents-grids` | `color/surface` | Tabular records |
|
|
314
|
-
| _e.g._ `_Button/Contained` | Primary CTA | `<igc-button variant="contained">` | `igniteui-webcomponents` | `color/primary/500` | n/a |
|
|
64
|
+
Read [references/figma-exploration.md](references/figma-exploration.md) in full before the first Figma MCP call. It has the call budget, how to tell the two Figma servers apart, exact tool arguments, extraction checklists, and table templates for each step:
|
|
315
65
|
|
|
316
|
-
|
|
317
|
-
|
|
66
|
+
| Step | What to do |
|
|
67
|
+
| ---- | ---------- |
|
|
68
|
+
| **1a** | Discover pages and artboards with `figma_get_metadata`. Record each target artboard's width and height — Phase 5 resizes the browser to them |
|
|
69
|
+
| **1b** | List the artboards and wait for the user to choose which to implement |
|
|
70
|
+
| **1c** | Capture one reference screenshot per artboard — the ground truth for Phase 5 |
|
|
71
|
+
| **1d** | Extract design context per artboard: layers and variant props, layout, typography, surfaces, input variants, chart colors, color census, control heights, action controls, provenance signals |
|
|
72
|
+
| **1e** | Extract design tokens with `figma_get_variable_defs`, once per target page |
|
|
73
|
+
| **1f** | Classify every component's provenance (Tier A Indigo.Design kit / B other library / C plain frames) and normalize it to a canonical role; check Code Connect mappings |
|
|
74
|
+
| **1g** | Build Table A (Ignite UI components, with tier, confidence, token work, and suspected anatomy deltas) and Table B (layout surfaces), then present both for review — low-confidence mappings first |
|
|
75
|
+
| **1h** | Extract every image asset to the project's assets directory — zero-placeholder policy |
|
|
318
76
|
|
|
319
|
-
|
|
320
|
-
after consulting `references/figma-component-map.md`. Document the reason inline.
|
|
77
|
+
Key constraints:
|
|
321
78
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
components — but they are critical to visual fidelity. Populate this table from the
|
|
327
|
-
`bg-[...]`, `rounded-[...]`, `border`, `p-[...]`, and `shadow-[...]` classes observed on
|
|
328
|
-
container divs in the Phase 1d output.
|
|
329
|
-
|
|
330
|
-
| Figma Frame / Container Name | Background | Border-Radius | Padding | Border | Shadow | Encloses (child sections) |
|
|
331
|
-
| ---------------------------- | ---------- | ------------- | ------- | ------ | ------ | ------------------------- |
|
|
332
|
-
| _e.g._ `Budget Categories` | `#222222` | `4px` | `24px` | none | none | Categories list, Add button |
|
|
333
|
-
| _e.g._ `Friend Card` | `#222222` | `8px` | `24px 16px` | `1px solid #333` | none | Avatar, name, phone, email, buttons |
|
|
334
|
-
|
|
335
|
-
> **Rule:** if a section sits on a surface in Figma (its container has a non-transparent
|
|
336
|
-
> background), it **must** have that background in the implementation. If a section floats
|
|
337
|
-
> on the page background (transparent), do **not** add a surface wrapper. Always derive
|
|
338
|
-
> surface structure from the design context of the specific artboard being implemented.
|
|
339
|
-
|
|
340
|
-
Present both tables to the user for review before proceeding.
|
|
341
|
-
|
|
342
|
-
### 1h: Extract Image Assets
|
|
343
|
-
|
|
344
|
-
Read [references/asset-extraction.md](references/asset-extraction.md) in full before
|
|
345
|
-
running any extraction.
|
|
346
|
-
|
|
347
|
-
**Zero-placeholder policy:** every image visible in the Figma design must be extracted and
|
|
348
|
-
committed to the project's assets directory before Phase 4. Gradient placeholders are not
|
|
349
|
-
acceptable.
|
|
350
|
-
|
|
351
|
-
From the decomposition tables, identify every layer that is a **static image asset**
|
|
352
|
-
(photo, background, logo, custom icon, illustration) rather than an Ignite UI component.
|
|
353
|
-
Do **not** extract Indigo.Design UI Kit component instances, and do not extract icons that
|
|
354
|
-
`igc-icon` can render from a registered collection.
|
|
355
|
-
|
|
356
|
-
**Use the four-tier decision tree from `asset-extraction.md`:**
|
|
357
|
-
|
|
358
|
-
| Tier | Method | When to use |
|
|
359
|
-
| ---- | ------ | ----------- |
|
|
360
|
-
| **1** | REST API `/v1/files/:key/images` (Method A) or `/v1/images/:key` (Method B) | File key available — always the highest fidelity |
|
|
361
|
-
| **2** | Download the asset URLs returned by `figma_get_design_context` with `curl` | File key unavailable; URLs still live |
|
|
362
|
-
| **3** | `figma_get_screenshot` per node | No file key, no asset URLs |
|
|
363
|
-
| **4** | CSS gradient/color placeholder with a `// TODO` comment | Only for confirmed pure-color fills — never as a shortcut |
|
|
364
|
-
|
|
365
|
-
Save assets under the project's static directory — `src/assets/images/` and
|
|
366
|
-
`src/assets/icons/` in a CLI-scaffolded Vite project (copied to the build output by
|
|
367
|
-
`vite-plugin-static-copy`); `public/` in a stock Vite app. Match whatever the project
|
|
368
|
-
already uses.
|
|
369
|
-
|
|
370
|
-
Build a concise asset manifest (see `asset-extraction.md § Build an Asset Manifest`) so
|
|
371
|
-
the implementation phase uses consistent paths.
|
|
372
|
-
|
|
373
|
-
If you used Tier 2 or Tier 3 for any asset, tell the user which ones need re-export once
|
|
374
|
-
the file key becomes available.
|
|
79
|
+
- **Rate limits:** limits depend on the Figma **seat**. A View/Collab seat allows 6 calls a month (20 on Starter), which may not cover one artboard. Compare the call estimate with the user's quota before starting, and discover structure with `figma_get_metadata` first.
|
|
80
|
+
- **Two Figma MCP servers:** the **remote** server (`mcp.figma.com`) takes `fileKey` and `nodeId`, so you can move between artboards yourself. The **desktop** server (`127.0.0.1:3845`) works only on the file open in the Figma desktop app. Pass the node ID from a frame link and check the response, or ask the user to select each artboard and do not batch those calls.
|
|
81
|
+
- **Any UI kit:** do not assume the Indigo.Design kits. Classify each component in 1f. A third-party kit's names, variables, and Code Connect mappings are evidence of the component's role. Never copy them into the code.
|
|
82
|
+
- **React + Tailwind output:** `figma_get_design_context` returns React + Tailwind code. Read it for information only — never copy it into the project, and never use its asset URLs as final assets.
|
|
375
83
|
|
|
376
84
|
---
|
|
377
85
|
|
|
378
86
|
## Phase 2 — Component Discovery (Ignite UI CLI MCP)
|
|
379
87
|
|
|
380
|
-
**Goal:** look up exact tags, attributes, slots, events, and registration requirements for
|
|
381
|
-
every component identified in Phase 1. Never generate component code from memory.
|
|
88
|
+
**Goal:** look up exact tags, attributes, slots, events, and registration requirements for every component identified in Phase 1. Never generate component code from memory.
|
|
382
89
|
|
|
383
90
|
### 2a: Read the Component Map
|
|
384
91
|
|
|
385
|
-
Read [references/figma-component-map.md](references/figma-component-map.md) in full.
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
92
|
+
Read [references/figma-component-map.md](references/figma-component-map.md) in full. For each row of the Phase 1g Table A:
|
|
93
|
+
|
|
94
|
+
- **Tier A:** find the Indigo.Design kit name in the kit tables.
|
|
95
|
+
- **Tier B/C:** find the canonical role in the **Canonical Role Index**, then the row it points to in the named section.
|
|
96
|
+
|
|
97
|
+
That row gives you the tag, the component class, the package, a `get_doc` starting point, and the key attributes and slots most often configured from Figma variants.
|
|
389
98
|
|
|
390
99
|
### 2b: Fetch Component Docs
|
|
391
100
|
|
|
392
|
-
> **
|
|
393
|
-
> as `navigation-drawer` (nav drawer), `text-area` (textarea), `data-grid` (premium grid),
|
|
394
|
-
> `grid-lite-overview`, `circular-progress`, and combo docs split across `overview`,
|
|
395
|
-
> `features`, `single-selection`, and `templates`. Never guess a doc name.
|
|
101
|
+
> **Doc names are not tag names** (`navigation-drawer`, `text-area`, `data-grid`, `overview` for combo). Never guess one — see `figma-component-map.md § Doc-name rules you will hit immediately`.
|
|
396
102
|
|
|
397
|
-
Call `list_components({ framework: "webcomponents" })` **once** to get the live catalog,
|
|
398
|
-
then:
|
|
103
|
+
Call `list_components({ framework: "webcomponents" })` **once** to get the live catalog, then:
|
|
399
104
|
|
|
400
|
-
- Resolve each component to its exact doc `name` from that list, and call
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
- For the full property/method/event API, call
|
|
404
|
-
`get_api_reference({ platform: "webcomponents", component: "<ClassName>" })`. Use
|
|
405
|
-
`search_api({ platform: "webcomponents", query: "<keyword>" })` first when the exact
|
|
406
|
-
class name is unknown, and use the `section` or `member` parameters to keep responses small.
|
|
407
|
-
- `get_project_setup_guide({ framework: "webcomponents" })` is available when the project's
|
|
408
|
-
setup (registration, theme import, package wiring) needs confirming.
|
|
105
|
+
- Resolve each component to its exact doc `name` from that list, and call `get_doc({ framework: "webcomponents", name: "<doc-name>" })` — all in a single parallel batch, never sequentially. `get_doc` gives usage patterns, HTML examples, and slot names.
|
|
106
|
+
- For the full property/method/event API, call `get_api_reference({ platform: "webcomponents", component: "<ClassName>" })`. Use `search_api({ platform: "webcomponents", query: "<keyword>" })` first when the exact class name is unknown, and use the `section` or `member` parameters to keep responses small.
|
|
107
|
+
- `get_project_setup_guide({ framework: "webcomponents" })` confirms registration, theme import, and package wiring when needed.
|
|
409
108
|
|
|
410
109
|
Do **not** write any component markup until you have read its doc or API entry.
|
|
411
110
|
|
|
@@ -419,246 +118,53 @@ search_docs({ framework: "webcomponents", query: "grid virtualization" })
|
|
|
419
118
|
search_docs({ framework: "webcomponents", query: "column pinning" })
|
|
420
119
|
```
|
|
421
120
|
|
|
422
|
-
Feature docs are mandatory when the artboard shows grid editing, filtering, sorting,
|
|
423
|
-
pinning, or other advanced feature states.
|
|
121
|
+
Feature docs are mandatory when the artboard shows grid editing, filtering, sorting, pinning, or other advanced feature states.
|
|
424
122
|
|
|
425
123
|
### 2d: Document the Final Component Plan
|
|
426
124
|
|
|
427
125
|
After reading all docs, confirm or revise the Phase 1g table with:
|
|
428
126
|
|
|
429
127
|
- Exact tags (e.g. `<igc-grid>`, `<igc-navbar>`) and component classes
|
|
430
|
-
- The **package** each component comes from, and trial
|
|
431
|
-
- The **registration** each one needs — `defineComponents(...)`
|
|
432
|
-
`IgcXxxComponent.register()` for the grid packages, `ModuleManager.register(...)` from
|
|
433
|
-
`igniteui-webcomponents-core` for charts and gauges
|
|
128
|
+
- The **package** each component comes from, and for the commercial packages (grids, charts, dock manager) whether the project uses the trial or the `@infragistics` licensed one
|
|
129
|
+
- The **registration** each one needs — see the registration cheat sheet in `figma-component-map.md` (`defineComponents(...)`, `IgcXxxComponent.register()`, `IgcGridLite.register()`, `ModuleManager.register(...)`, and `defineComponents` from `igniteui-dockmanager`)
|
|
434
130
|
- Any additional theme CSS a package requires (the grid packages ship their own)
|
|
435
131
|
|
|
436
|
-
|
|
437
|
-
before installing**. Present this updated plan to the user and wait for confirmation before
|
|
438
|
-
Phase 3.
|
|
439
|
-
|
|
440
|
-
---
|
|
441
|
-
|
|
442
|
-
## Phase 3 — Theme Generation (Ignite UI Theming MCP)
|
|
443
|
-
|
|
444
|
-
**Goal:** produce theming code that matches the Figma design's visual language using the
|
|
445
|
-
design tokens extracted in Phase 1e.
|
|
446
|
-
|
|
447
|
-
Read [references/design-token-bridge.md](references/design-token-bridge.md) in full before
|
|
448
|
-
running any theming tool.
|
|
449
|
-
|
|
450
|
-
> **Output format decision — make it once, here.** Pass `output: "css"` (the default) when
|
|
451
|
-
> the project has no Sass; pass `output: "sass"` only when Phase 0b found a Sass setup.
|
|
452
|
-
> Every theming tool below accepts `output`. Do not emit Sass into a project that cannot
|
|
453
|
-
> compile it, and do not use the Angular-only `core()` / `theme()` mixins — the Web
|
|
454
|
-
> Components Sass API uses `igniteui-theming` with individual `palette()`, `typography()`,
|
|
455
|
-
> `elevations()`, and `spacing()` mixins.
|
|
456
|
-
|
|
457
|
-
### 3a: Inspect the Existing Theme (Guard)
|
|
458
|
-
|
|
459
|
-
Open the app entry point and global stylesheet (`src/index.ts` / `main.ts`, `styles.css`,
|
|
460
|
-
or the project's equivalent). Look for:
|
|
461
|
-
|
|
462
|
-
- a pre-built theme import such as `igniteui-webcomponents/themes/dark/material.css`
|
|
463
|
-
- `--ig-theme` / `--ig-theme-variant` declarations on `:root`
|
|
464
|
-
- a `configureTheme(...)` call
|
|
465
|
-
- existing palette overrides (`--ig-primary-500`, …) or app-level semantic variables
|
|
466
|
-
|
|
467
|
-
Then:
|
|
468
|
-
|
|
469
|
-
- **Theme found, but variant mismatch** — if the existing theme is **light** and the Figma
|
|
470
|
-
design is **dark** (or vice versa), treat this as a theme change and proceed with 3b–3c.
|
|
471
|
-
A light theme applied to a dark design produces wrong background colors on every
|
|
472
|
-
component and will fail every Phase 5 check.
|
|
473
|
-
- **Theme found, variant matches** → do **not** regenerate the global theme unless the user
|
|
474
|
-
explicitly asks. Reuse the existing palette and skip to 3d.
|
|
475
|
-
- **No theme found** → proceed with 3b.
|
|
476
|
-
|
|
477
|
-
Detect the Figma design's variant from Phase 1e: if a `color/mode` variable exists, use its
|
|
478
|
-
value. Otherwise use the artboard background color: near-black (`#121212`, `#1a1a1a`,
|
|
479
|
-
`#000`) → `"dark"`; near-white (`#fff`, `#f5f5f5`) → `"light"`.
|
|
480
|
-
|
|
481
|
-
### 3b: Resolve the Design System
|
|
482
|
-
|
|
483
|
-
To determine the design system, use this **strict precedence order**. Stop at the first
|
|
484
|
-
signal that gives a clear answer:
|
|
485
|
-
|
|
486
|
-
1. **Explicit user request** — "make it Material", "use Fluent", etc.
|
|
487
|
-
2. **Library source name in design context** — the `figma_get_design_context` or
|
|
488
|
-
`figma_get_metadata` response may reference the source library file name
|
|
489
|
-
(e.g. `"Indigo.Design UI Kit for Material"` → `material`).
|
|
490
|
-
3. **Variable collection names from Phase 1e** — collection names like
|
|
491
|
-
`Material/color/primary` identify the kit variant directly.
|
|
492
|
-
4. **Elevation variable structure** — inspect the `Elevations/*` variables:
|
|
493
|
-
- **Three-layer DROP_SHADOW** (umbra + penumbra + ambient) → **Material**
|
|
494
|
-
- **Single-layer DROP_SHADOW** → Indigo, Fluent, or Bootstrap
|
|
495
|
-
5. **Palette shade naming** — `primary/500`, `primary/100`–`primary/900` follows the
|
|
496
|
-
Material 100–900 convention → likely **Material**.
|
|
497
|
-
6. **Visual heuristics** (only when all above are inconclusive):
|
|
498
|
-
prominent shadows + ripple effects → `"material"`;
|
|
499
|
-
flat surfaces + sharp corners + Segoe/Inter font → `"fluent"`;
|
|
500
|
-
component borders + Bootstrap grid → `"bootstrap"`;
|
|
501
|
-
rounded purple/indigo accents without Material shadows → `"indigo"`.
|
|
502
|
-
|
|
503
|
-
> **Never use font name as a primary signal.** "Titillium Web" is the default body font in
|
|
504
|
-
> the Indigo.Design UI Kit for Material — it is not exclusive to the Indigo design system.
|
|
505
|
-
|
|
506
|
-
Supported values: `material`, `bootstrap`, `fluent`, `indigo`.
|
|
507
|
-
|
|
508
|
-
> **Web Components read the active design system from CSS variables for the initial theme.**
|
|
509
|
-
> Components read `--ig-theme` and `--ig-theme-variant` (falling back to `bootstrap` /
|
|
510
|
-
> `light` when absent). A generated palette alone does **not** switch the design system —
|
|
511
|
-
> use the pre-built theme CSS or generated `:root` block for that. `configureTheme(ds, variant)`
|
|
512
|
-
> switches registered components at runtime but does not rewrite those root variables.
|
|
513
|
-
|
|
514
|
-
### 3c: Generate the Global Theme
|
|
515
|
-
|
|
516
|
-
Extract the following from Phase 1e variables using
|
|
517
|
-
[references/design-token-bridge.md](references/design-token-bridge.md):
|
|
518
|
-
|
|
519
|
-
```
|
|
520
|
-
primaryColor ← from "color/primary/500" or "primary/500"
|
|
521
|
-
secondaryColor ← from "color/secondary/500" or "secondary/500"
|
|
522
|
-
surfaceColor ← from "color/surface" or "surface/default"
|
|
523
|
-
fontFamily ← from "typography/font-family" or "typography/body/font-family"
|
|
524
|
-
```
|
|
525
|
-
|
|
526
|
-
Read the theming guidance resources before generating, so you extract only values the
|
|
527
|
-
theme system actually accepts:
|
|
528
|
-
|
|
529
|
-
```
|
|
530
|
-
theming_read_resource({ uri: "theming://guidance/colors/rules" }) // luminance + variant rules
|
|
531
|
-
theming_read_resource({ uri: "theming://platforms/webcomponents" }) // platform specifics
|
|
532
|
-
```
|
|
533
|
-
|
|
534
|
-
**CSS path (default — no Sass in the project):**
|
|
535
|
-
|
|
536
|
-
1. Import the pre-built theme CSS for the resolved design system and variant in the app
|
|
537
|
-
entry point. This sets `--ig-theme`, `--ig-theme-variant`, the full palette, typography,
|
|
538
|
-
and elevations in one line:
|
|
132
|
+
**Anatomy delta ledger (Tier B and C).** For every mapped component whose anatomy differs from the design in a way that tokens, `::part(...)`, or slotted content **cannot** close, add a ledger entry:
|
|
539
133
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
```
|
|
547
|
-
theming_create_palette({
|
|
548
|
-
primary: primaryColor,
|
|
549
|
-
secondary: secondaryColor,
|
|
550
|
-
surface: surfaceColor,
|
|
551
|
-
variant: "<light|dark>",
|
|
552
|
-
platform: "webcomponents",
|
|
553
|
-
licensed: <true if @infragistics package>,
|
|
554
|
-
output: "css"
|
|
555
|
-
})
|
|
556
|
-
```
|
|
557
|
-
|
|
558
|
-
Apply the generated custom properties to `:root` in the global stylesheet. Overriding
|
|
559
|
-
the `*-500` base shade is enough — the remaining shades derive from it.
|
|
560
|
-
|
|
561
|
-
3. Apply typography with plain CSS (`font-family`, `font-size`, `font-weight`) or the CSS
|
|
562
|
-
output of `theming_create_typography`. Do not emit Sass typography mixins into a
|
|
563
|
-
CSS-only app.
|
|
134
|
+
| Component | Design shows | Ignite UI renders | Options | Decision |
|
|
135
|
+
| --- | --- | --- | --- | --- |
|
|
136
|
+
| _e.g._ Text fields (shadcn) | Label above the field | Label above (baseline `bootstrap`) | — | none needed |
|
|
137
|
+
| _e.g._ M3 segmented button | Check icon on the selected segment | `igc-toggle-button`, no check icon | Slot an `igc-icon` in the selected item / accept | ask |
|
|
138
|
+
| _e.g._ Bottom sheet | Sheet sliding from the bottom | No sheet component | `igc-dialog` styled / custom markup | ask |
|
|
564
139
|
|
|
565
|
-
|
|
566
|
-
several distinct surface depths that one generated surface color cannot express, use
|
|
567
|
-
`theming_create_custom_palette`, or define semantic variables (`--surface-1`,
|
|
568
|
-
`--surface-2`) for the extra depths.
|
|
140
|
+
Do not ledger differences that tokens *can* close: color, radius, border, casing, height, and spacing are implementation work, not deltas. For every interactive control, prefer the Ignite UI component with a recorded delta over hand-built markup. The component's keyboard, focus, ARIA, and form behavior are worth more than a pixel-exact but inert copy. Approved entries are classified **Accepted** in Phase 5.
|
|
569
141
|
|
|
570
|
-
|
|
142
|
+
If new packages are required (including an icon package for a third-party kit), identify exact packages and versions, then **ask for approval before installing**. Present this updated plan, with the ledger, to the user and wait for confirmation before Phase 3.
|
|
571
143
|
|
|
572
|
-
|
|
573
|
-
theming_create_theme({
|
|
574
|
-
platform: "webcomponents",
|
|
575
|
-
designSystem: "<resolved design system>",
|
|
576
|
-
primaryColor, secondaryColor, surfaceColor,
|
|
577
|
-
variant: "<light|dark>",
|
|
578
|
-
fontFamily,
|
|
579
|
-
includeTypography: true,
|
|
580
|
-
includeElevations: true,
|
|
581
|
-
includeSpacing: true,
|
|
582
|
-
licensed: <true if @infragistics package>,
|
|
583
|
-
output: "sass"
|
|
584
|
-
})
|
|
585
|
-
```
|
|
586
|
-
|
|
587
|
-
`theming_create_theme` emits the `@use 'igniteui-theming'` imports, the `palette()` /
|
|
588
|
-
`elevations()` / `typography()` / `spacing()` mixin calls, and the `:root` block with
|
|
589
|
-
`--ig-theme` and `--ig-theme-variant`. Apply its output as instructed in the response.
|
|
590
|
-
Use `theming_create_palette` / `theming_create_typography` / `theming_create_elevations`
|
|
591
|
-
individually only when you need one piece.
|
|
592
|
-
|
|
593
|
-
> `theming_create_elevations` takes **`designSystem`** (`"material"` or `"indigo"`) — there
|
|
594
|
-
> is no `preset` parameter.
|
|
595
|
-
|
|
596
|
-
**Runtime switching.** When the design needs light and dark at runtime, either swap the
|
|
597
|
-
pre-built stylesheet or call the library API:
|
|
144
|
+
---
|
|
598
145
|
|
|
599
|
-
|
|
600
|
-
import { configureTheme } from 'igniteui-webcomponents';
|
|
601
|
-
configureTheme('material', 'dark');
|
|
602
|
-
```
|
|
146
|
+
## Phase 3 — Theme Generation (Ignite UI Theming MCP)
|
|
603
147
|
|
|
604
|
-
**
|
|
605
|
-
`igniteui-webcomponents-grids/grids/themes/<variant>/<design-system>.css` in addition to
|
|
606
|
-
the core theme, and inside a Lit component that CSS must be imported `?inline` and injected
|
|
607
|
-
into the shadow root:
|
|
148
|
+
**Goal:** produce theming code that matches the Figma design's visual language, using the kit variables from Phase 1e (Path A) or the color census and measurements from Phase 1d (Path B).
|
|
608
149
|
|
|
609
|
-
|
|
610
|
-
import gridTheme from 'igniteui-webcomponents-grids/grids/themes/dark/material.css?inline';
|
|
611
|
-
// in render(): html`<style>${gridTheme}</style> <igc-grid ...></igc-grid>`
|
|
612
|
-
```
|
|
150
|
+
Read [references/theme-generation.md](references/theme-generation.md) and [references/design-token-bridge.md](references/design-token-bridge.md) in full before running any theming tool. The steps are:
|
|
613
151
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
For **every** Ignite UI component in your plan, run this loop:
|
|
622
|
-
|
|
623
|
-
1. `theming_get_component_design_tokens({ component: "<theme-key>" })` — review all token
|
|
624
|
-
names, types, and descriptions, plus any **related themes** listed for compound
|
|
625
|
-
components. Theme keys are not always the tag name: inputs are `input-group`, the nav
|
|
626
|
-
drawer is `navdrawer`, progress bars are `progress-linear` / `progress-circular`, and a
|
|
627
|
-
single-select combo is `simple-combo`. See
|
|
628
|
-
[references/design-token-bridge.md](references/design-token-bridge.md) for the full map.
|
|
629
|
-
2. Go back to the Phase 1e variable map and find the Figma variables that correspond to
|
|
630
|
-
this component's surfaces (background, text, border, hover state).
|
|
631
|
-
3. `theming_create_component_theme({ component: "<theme-key>", platform: "webcomponents", designSystem: "<resolved>", variant: "<light|dark>", tokens: { <only differing tokens> }, output: "css" | "sass" })`
|
|
632
|
-
4. Apply the generated block exactly as returned — to the component selector or to the
|
|
633
|
-
`selector` you passed. Token values must reference palette variables
|
|
634
|
-
(`var(--ig-primary-500)`), never raw hex.
|
|
635
|
-
5. For compound components (`combo`, `select`, `date-picker`, `date-range-picker`, `grid`),
|
|
636
|
-
follow the related-theme chain from step 1 and theme each child with its scoped selector.
|
|
637
|
-
Styling only the parent leaves the dropdown or calendar off-theme.
|
|
638
|
-
|
|
639
|
-
When a specific component needs a different density or spacing from the global default, use
|
|
640
|
-
`theming_set_size` or `theming_set_spacing` with the `component` parameter — this scopes
|
|
641
|
-
`--ig-size` or `--ig-spacing` to that component's selector rather than applying globally.
|
|
642
|
-
For compound components, use `scope` with a sub-component selector. Only apply these
|
|
643
|
-
globally (`:root`) when the entire app has a clearly distinct density. Leave
|
|
644
|
-
`theming_set_roundness` at its default unless the user explicitly requests a change. Never
|
|
645
|
-
derive multiplier values from Figma pixel values — see
|
|
646
|
-
`references/design-token-bridge.md § Spacing, Sizing, and Roundness`.
|
|
647
|
-
|
|
648
|
-
### 3e: Chart Series Colors
|
|
649
|
-
|
|
650
|
-
Charts have no design tokens, and they default to their own brush palette — which will not
|
|
651
|
-
match the Figma series colors. Before implementing any chart:
|
|
152
|
+
| Step | What to do |
|
|
153
|
+
| ---- | ---------- |
|
|
154
|
+
| **3a** | Inspect the entry point and global stylesheet. The CLI scaffold's starter theme counts as no theme. Reuse an app's own theme only if its variant, design system, and primary color all match the design; otherwise ask before changing it |
|
|
155
|
+
| **3b** | Choose the path from the dominant Phase 1f tier. **Path A** (Indigo.Design kits): resolve the design system with the strict precedence order. **Path B** (other kits or none): pick the closest baseline — the user's request, then the kit's direct counterpart, then input label placement, then control heights. In a mixed file, count only rows that map to a component |
|
|
156
|
+
| **3c** | CSS path: import the pre-built theme for the design system and variant, then add `theming_create_palette` overrides. Sass path: one `theming_create_theme` call (plus `theming_create_palette` for `gray` or status colors). **Path B:** seed from the color census, then override the type styles that differ (including button casing) with `--ig-<style>-<property>` CSS variables. Do not rely on `customScale`: `theming_create_typography` accepts it, but its generators ignore it |
|
|
157
|
+
| **3d** | Map per-component tokens for every Ignite UI component in the plan, always passing `designSystem` and `variant`. Path B also sets radius, border, shadow, and state tokens, and picks `--ig-size` per component family from measured heights |
|
|
158
|
+
| **3e** | Validate chart series colors with `theming_get_chart_series_colors` and assign them to the chart's brush properties (`brushes`/`outlines`; `brush` on sparkline, `fillBrushes` on treemap, the ring series on doughnut) |
|
|
652
159
|
|
|
653
|
-
|
|
654
|
-
theming_get_chart_series_colors({ chartType: "<e.g. category-chart>" })
|
|
655
|
-
theming_get_chart_series_colors({ customBrushes: ["#9DE772", "#6DB1FF"] }) // validate Figma colors
|
|
656
|
-
```
|
|
160
|
+
Key constraints:
|
|
657
161
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
162
|
+
- **Output format:** CSS by default; Sass only when the project is configured for it. Never use the Angular-only `core()` / `theme()` mixins.
|
|
163
|
+
- `theming_create_palette` takes `primary`/`secondary`/`surface`/`gray`/`success`/`warn`/`error`/`info` and `variant`, while `theming_create_theme` takes `primaryColor`/`secondaryColor`/`surfaceColor` (no `gray`).
|
|
164
|
+
- `theming_create_elevations` takes `designSystem` (`material` or `indigo`); there is no `preset` parameter.
|
|
165
|
+
- Never use the font name as the primary design-system signal.
|
|
166
|
+
- Never convert Figma pixel values into `theming_set_spacing` or `theming_set_roundness` multipliers. `--ig-size` is different: it is a size step (`small` / `medium` / `large`), not a multiplier. Path A keeps the default; Path B picks the nearest step per component family (3d).
|
|
167
|
+
- **Path B:** seed the palette with the color painted on the component, not the variable named `…/500`. On a `material` baseline, buttons, checkboxes, and switches use `secondary`, so seed it with the button color.
|
|
662
168
|
|
|
663
169
|
---
|
|
664
170
|
|
|
@@ -668,114 +174,49 @@ on the element, not as attributes).
|
|
|
668
174
|
|
|
669
175
|
### Implementation Rules
|
|
670
176
|
|
|
671
|
-
1. **Never generate component markup without reading its doc or API entry first** (Phase 2b).
|
|
177
|
+
1. **Never generate component markup without reading its doc or API entry first** — the `get_doc` result, or the skill reference file when the catalog has no doc (Phase 2b).
|
|
672
178
|
2. **Section by section** — layout → navigation → primary content → secondary → data.
|
|
673
179
|
3. **Register every custom element you use, once, in the right place.**
|
|
674
180
|
```typescript
|
|
675
181
|
import { defineComponents, IgcNavbarComponent, IgcCardComponent } from 'igniteui-webcomponents';
|
|
676
182
|
defineComponents(IgcNavbarComponent, IgcCardComponent);
|
|
677
183
|
```
|
|
678
|
-
Grids use `IgcGridComponent.register()
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
[`igniteui-wc-optimize-bundle-size`](../igniteui-wc-optimize-bundle-size/SKILL.md).
|
|
684
|
-
4. **Respect the shadow DOM boundary.** Page CSS does not reach a component's internals.
|
|
685
|
-
In order of preference: component **design tokens** (Phase 3d) → documented
|
|
686
|
-
`::part(...)` selectors → slotted content you style yourself. Never target internal
|
|
687
|
-
class names. CSS custom properties **do** inherit through shadow roots, which is why all
|
|
688
|
-
color work goes through palette variables.
|
|
689
|
-
5. **Slots, not attributes, carry content.** `igc-list-item` uses `start` / `title` /
|
|
690
|
-
`subtitle` / `end`; `igc-navbar` uses `start` / `end`; `igc-card` composes
|
|
691
|
-
`igc-card-header`, `igc-card-content`, `igc-card-actions`, `igc-card-media`. Confirm the
|
|
692
|
-
slot names from `get_doc` before writing markup.
|
|
693
|
-
6. **Bind non-primitive values as properties, not attributes.** Arrays, objects, and
|
|
694
|
-
functions (chart `brushes`, grid `data`, combo `data`) must be assigned on the element
|
|
695
|
-
(`.data=${rows}` in Lit, `el.brushes = [...]` in plain JS). A serialized attribute
|
|
696
|
-
silently fails.
|
|
697
|
-
7. **Events are `igc*`-prefixed** (`igcChange`, `igcInput`, `igcClosing`, …) — take the
|
|
698
|
-
exact names from `get_api_reference`, and remember there is no two-way binding.
|
|
184
|
+
Grids use `IgcGridComponent.register()`, Grid Lite `IgcGridLite.register()`, charts and gauges `ModuleManager.register(IgcCategoryChartModule, …)` from `igniteui-webcomponents-core`, and the dock manager `defineComponents(IgcDockManagerComponent)` from `igniteui-dockmanager` (trial) or `@infragistics/igniteui-dockmanager` (licensed). In a framework-wrapped app, follow [`igniteui-wc-integrate-with-framework`](../igniteui-wc-integrate-with-framework/SKILL.md) instead. Registering components you do not use inflates the bundle — see [`igniteui-wc-optimize-bundle-size`](../igniteui-wc-optimize-bundle-size/SKILL.md).
|
|
185
|
+
4. **Respect the shadow DOM boundary.** Page CSS does not reach a component's internals. In order of preference: component **design tokens** (Phase 3d) → documented `::part(...)` selectors → slotted content you style yourself. Never target internal class names. CSS custom properties **do** inherit through shadow roots, which is why all color work goes through palette variables.
|
|
186
|
+
5. **Slots, not attributes, carry content.** `igc-list-item` uses `start` / `title` / `subtitle` / `end`; `igc-navbar` uses `start` / `end`; `igc-card` composes `igc-card-header`, `igc-card-content`, `igc-card-actions`, `igc-card-media`. Confirm the slot names from `get_doc` before writing markup.
|
|
187
|
+
6. **Bind non-primitive values as properties, not attributes.** Arrays, objects, and functions (grid `data`, chart `dataSource`, combo `data`) must be assigned on the element (`.data=${rows}` in Lit, `el.dataSource = rows` in plain JS). A serialized attribute silently fails. Assign chart brushes as properties too.
|
|
188
|
+
7. **Events are `igc*`-prefixed** (`igcChange`, `igcInput`, `igcClosing`, …) — take the exact names from `get_api_reference`, and remember there is no two-way binding.
|
|
699
189
|
8. Use CSS Grid first to match Figma frame proportions; add Flexbox for sub-regions.
|
|
700
|
-
9. Apply theming via the tokens and palette variables generated in Phase 3 — no raw hex
|
|
701
|
-
values in view code.
|
|
190
|
+
9. Apply theming via the tokens and palette variables generated in Phase 3 — no raw hex values in view code.
|
|
702
191
|
10. Use typed mock data that matches the design's density and domain.
|
|
703
|
-
11. Keep layout, spacing, and typography in stylesheets (or the component's `static styles`)
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
and the other input-base components. Map `_Input/Border` → `outlined`; map `_Input/Line`
|
|
709
|
-
and `_Input/Box` → default (no `outlined`). There is **no** global injection token
|
|
710
|
-
equivalent — set the attribute on each control, and close any remaining gap with
|
|
711
|
-
`input-group` component tokens rather than internal CSS.
|
|
712
|
-
13. **Layout surfaces:** for every entry in the Phase 1g Surfaces table, add a CSS class
|
|
713
|
-
with the recorded `background`, `border-radius`, `padding`, `border`, and `box-shadow`.
|
|
714
|
-
Never leave a section transparent if the Figma surface has a background; never add a
|
|
715
|
-
background to a section that floats on the page background in the design.
|
|
716
|
-
14. **Implement only controls that appear in the Figma artboard.** Do not add toolbar
|
|
717
|
-
buttons, actions, or UI elements that look useful but are not in the design context
|
|
718
|
-
output for that artboard.
|
|
719
|
-
15. After implementing each major section, save and check in the browser (if the dev server
|
|
720
|
-
is running).
|
|
721
|
-
|
|
722
|
-
### Layout Strategy
|
|
723
|
-
|
|
724
|
-
Translate Figma frame dimensions into CSS Grid first:
|
|
725
|
-
|
|
726
|
-
```css
|
|
727
|
-
/* Artboard: 1440×900px, sidebar 280px, content 1160px */
|
|
728
|
-
.app-layout {
|
|
729
|
-
display: grid;
|
|
730
|
-
grid-template-columns: 280px 1fr;
|
|
731
|
-
grid-template-rows: 64px 1fr;
|
|
732
|
-
min-height: 100vh;
|
|
733
|
-
}
|
|
734
|
-
```
|
|
735
|
-
|
|
736
|
-
Match desktop proportions before adding responsive breakpoints.
|
|
737
|
-
|
|
738
|
-
> A Lit component's host is `display: inline` by default — set `:host { display: block }`
|
|
739
|
-
> (or `grid`/`flex`) or the layout collapses. Charts and grids inside a flexible grid track
|
|
740
|
-
> need an explicit height on both the track and the element.
|
|
192
|
+
11. Keep layout, spacing, and typography in stylesheets (or the component's `static styles`) — not inline styles.
|
|
193
|
+
12. **Input variants:** the Indigo.Design kits express `line` / `box` / `border` input types; Web Components expose a single boolean **`outlined`** attribute on `igc-input`, `igc-textarea`, `igc-select`, `igc-combo`, `igc-date-picker`, `igc-date-range-picker`, and the other input-base components. Map `_Input/Border` → `outlined`; map `_Input/Line` and `_Input/Box` → default (no `outlined`). For other kits, map the normalized style: **outlined** → `outlined`; **filled** / **underlined** → default. Label placement comes from the baseline design system (3b), not from an attribute. There is **no** global injection token equivalent — set the attribute on each control, and close any remaining gap with `input-group` component tokens rather than internal CSS.
|
|
194
|
+
13. **Layout surfaces:** for every entry in the Phase 1g Table B (Layout Surfaces), add a CSS class with the recorded `background`, `border-radius`, `padding`, `border`, and `box-shadow`. Never leave a section transparent if the Figma surface has a background; never add a background to a section that floats on the page background in the design.
|
|
195
|
+
14. **Implement only controls that appear in the Figma artboard.** Do not add toolbar buttons, actions, or UI elements that look useful but are not in the design context output for that artboard.
|
|
196
|
+
15. After each major section, check it in the browser if the dev server is running.
|
|
741
197
|
|
|
742
|
-
###
|
|
198
|
+
### Layout and File Structure
|
|
743
199
|
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
```
|
|
747
|
-
src/app/
|
|
748
|
-
<artboard-name>/
|
|
749
|
-
<artboard-name>.ts ← Lit component: template, static styles, registration
|
|
750
|
-
data.ts ← typed mock data for the view
|
|
751
|
-
_assets.ts ← asset manifest from Phase 1h (when the view has images)
|
|
752
|
-
```
|
|
753
|
-
|
|
754
|
-
Register the route in `src/app/app-routing.ts` when the project uses routing. In a
|
|
755
|
-
non-Lit project, follow the structure already in the repository.
|
|
200
|
+
Translate Figma frame dimensions into CSS Grid first, matching desktop proportions before adding breakpoints, and place each view where the project expects it. The grid pattern, the Lit host-display pitfall, and the per-view file layout are in [references/project-setup.md § Implementation Layout](references/project-setup.md#implementation-layout).
|
|
756
201
|
|
|
757
202
|
---
|
|
758
203
|
|
|
759
204
|
## Phase 5 — Visual Validation (Playwright MCP)
|
|
760
205
|
|
|
761
|
-
**Goal:** measure and compare the running app against the Figma reference screenshots from
|
|
762
|
-
Phase 1c. Use the measurement-driven loop — compare numbers, not impressions.
|
|
206
|
+
**Goal:** measure and compare the running app against the Figma reference screenshots from Phase 1c. Use the measurement-driven loop — compare numbers, not impressions.
|
|
763
207
|
|
|
764
|
-
Read [references/validation-patterns.md](references/validation-patterns.md) in full before
|
|
765
|
-
running any Playwright tool.
|
|
208
|
+
Read [references/validation-patterns.md](references/validation-patterns.md) in full before running any Playwright tool.
|
|
766
209
|
|
|
767
210
|
### 5a: Ensure the Dev Server Is Running
|
|
768
211
|
|
|
769
|
-
Ask the user for the local dev URL if not already known (Vite default:
|
|
770
|
-
`http://localhost:5173`).
|
|
212
|
+
Ask the user for the local dev URL if not already known (Vite default: `http://localhost:5173`).
|
|
771
213
|
|
|
772
214
|
```
|
|
773
215
|
playwright_browser_navigate({ url: "http://localhost:5173" })
|
|
774
216
|
playwright_browser_console_messages() // check for startup errors
|
|
775
217
|
```
|
|
776
218
|
|
|
777
|
-
Unregistered custom elements are a silent failure mode: the element renders as an empty
|
|
778
|
-
inline box with no console error. If a section is missing, check `defineComponents` first.
|
|
219
|
+
Unregistered custom elements are a silent failure mode: the element renders as an empty inline box with no console error. If a section is missing, check `defineComponents` first.
|
|
779
220
|
|
|
780
221
|
### 5b: Match Viewport to Artboard Dimensions
|
|
781
222
|
|
|
@@ -784,8 +225,7 @@ playwright_browser_resize({ width: <artboard.width>, height: <artboard.height> }
|
|
|
784
225
|
playwright_browser_navigate({ url: "<target route>" }) // re-navigate after resize
|
|
785
226
|
```
|
|
786
227
|
|
|
787
|
-
> **Always re-navigate after resize.** The browser may reset to `about:blank` on viewport
|
|
788
|
-
> change. This is a known Playwright MCP pitfall.
|
|
228
|
+
> **Always re-navigate after resize.** The browser may reset to `about:blank` on viewport change. This is a known Playwright MCP pitfall.
|
|
789
229
|
|
|
790
230
|
### 5c: Capture and Compare Screenshots
|
|
791
231
|
|
|
@@ -796,49 +236,33 @@ For **each target artboard** (run the full 5c–5f loop once per page):
|
|
|
796
236
|
```
|
|
797
237
|
playwright_browser_take_screenshot({ type: "png" })
|
|
798
238
|
```
|
|
799
|
-
3. Do a **section-by-section** comparison against the Phase 1c reference file:
|
|
800
|
-
|
|
801
|
-
4. Do **not** advance to the next artboard until no Critical/Major issues remain on the
|
|
802
|
-
current one.
|
|
239
|
+
3. Do a **section-by-section** comparison against the Phase 1c reference file: top bar → sidebar → **every section in the Phase 1g Table B** → footer.
|
|
240
|
+
4. Do **not** advance to the next artboard until only Cosmetic and Accepted items remain on the current one.
|
|
803
241
|
|
|
804
242
|
### 5d: Measure Computed Styles
|
|
805
243
|
|
|
806
|
-
For each section with visible differences — and **mandatorily for every entry in the Phase
|
|
807
|
-
1g Surfaces table** — use `playwright_browser_evaluate` to extract exact values. Pass code
|
|
808
|
-
as a **plain JavaScript function string** using the `function` parameter.
|
|
244
|
+
For each section with visible differences — and **mandatorily for every entry in the Phase 1g Table B** — use `playwright_browser_evaluate` to extract exact values. Pass code as a **plain JavaScript function string** using the `function` parameter.
|
|
809
245
|
|
|
810
|
-
> **Shadow DOM changes every measurement.** `document.querySelector('igc-card .title')`
|
|
811
|
-
> returns `null` — the inner nodes live in a shadow root. Measure the host element for box
|
|
812
|
-
> metrics, and pierce with `el.shadowRoot.querySelector(...)` (or `::part` targets) for
|
|
813
|
-
> internals. `references/validation-patterns.md` provides a reusable deep-query helper —
|
|
814
|
-
> use it instead of writing ad-hoc selectors.
|
|
246
|
+
> **Shadow DOM changes every measurement.** `document.querySelector('igc-card .title')` returns `null` — the inner nodes live in a shadow root. Measure the host element for box metrics, and pierce with `el.shadowRoot.querySelector(...)` (or `::part` targets) for internals. `references/validation-patterns.md` provides a reusable deep-query helper — use it instead of writing ad-hoc selectors.
|
|
815
247
|
|
|
816
|
-
|
|
817
|
-
table, assert:
|
|
818
|
-
- `backgroundColor` is **not** `rgba(0, 0, 0, 0)` when the surface has a background color
|
|
819
|
-
- `backgroundColor` **is** `rgba(0, 0, 0, 0)` when the design shows the section floating on
|
|
820
|
-
the page background
|
|
821
|
-
- all child elements shown inside the surface card in Figma are enclosed within the card's
|
|
822
|
-
bounding rect in the DOM
|
|
248
|
+
Run the three mandatory audits from `validation-patterns.md` on every page, and compare all returned values against the Figma spec from Phase 1d:
|
|
823
249
|
|
|
824
|
-
**
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
must be removed.
|
|
828
|
-
|
|
829
|
-
**Registration audit:** assert that every `igc-*` tag used on the page is a defined custom
|
|
830
|
-
element (`customElements.get(tag)`); an undefined tag means a missing registration.
|
|
831
|
-
|
|
832
|
-
Compare all returned values against the Figma spec from Phase 1d.
|
|
250
|
+
- **Surfaces audit** — every Table B section has the recorded background (or none, when it floats on the page), and encloses the children shown inside it in Figma.
|
|
251
|
+
- **Action controls audit** — every visible control, shadow roots included, is in the Phase 1d inventory. Anything else is fabricated and must be removed.
|
|
252
|
+
- **Registration audit** — every `igc-*` tag on the page is a defined custom element.
|
|
833
253
|
|
|
834
254
|
### 5e: Classify and Report Mismatches
|
|
835
255
|
|
|
836
256
|
| Severity | Category | Example | Action |
|
|
837
257
|
| ------------ | --------------- | ----------------------------------------- | --------------------------- |
|
|
838
|
-
| **Critical** | Missing element | Button in Figma, absent in code |
|
|
839
|
-
| **Major** | Wrong component | Figma shows dropdown, code has text input |
|
|
840
|
-
| **
|
|
841
|
-
| **
|
|
258
|
+
| **Critical** | Missing element | Button in Figma, absent in code | Fix |
|
|
259
|
+
| **Major** | Wrong component | Figma shows dropdown, code has text input | Fix |
|
|
260
|
+
| **Major** | Token-fixable | Wrong color shade, radius, border, casing, or height > 4px | Fix |
|
|
261
|
+
| **Minor** | Spacing off | 24px gap in Figma, 16px in code | Fix |
|
|
262
|
+
| **Cosmetic** | Rounding only | `rgb(51, 51, 51)` vs `#333333`; ≤ 4px size | Report only |
|
|
263
|
+
| **Accepted** | Approved delta | A ledger entry the user approved | Report only; not a retry |
|
|
264
|
+
|
|
265
|
+
The full table and the definitions are in `validation-patterns.md § Mismatch Severity Classification`. A visibly different color is Major, not Cosmetic. **Accepted** needs the user's approval of a ledger entry, from Phase 2d or added during Phase 5.
|
|
842
266
|
|
|
843
267
|
For each mismatch, produce:
|
|
844
268
|
|
|
@@ -847,21 +271,20 @@ ISSUE: <description>
|
|
|
847
271
|
LOCATION: <section or component>
|
|
848
272
|
FIGMA: <spec value>
|
|
849
273
|
RENDERED: <measured value>
|
|
850
|
-
SEVERITY: <Critical / Major / Minor / Cosmetic>
|
|
274
|
+
SEVERITY: <Critical / Major / Minor / Cosmetic / Accepted>
|
|
851
275
|
FIX: <specific code change>
|
|
852
276
|
```
|
|
853
277
|
|
|
854
278
|
### 5f: Apply Corrections
|
|
855
279
|
|
|
856
|
-
Fix Critical and
|
|
857
|
-
fresh screenshot to confirm:
|
|
280
|
+
Fix Critical, Major, and Minor issues. After applying fixes, re-navigate and take a fresh screenshot to confirm:
|
|
858
281
|
|
|
859
282
|
```
|
|
860
283
|
playwright_browser_navigate({ url: "<target route>" })
|
|
861
284
|
playwright_browser_take_screenshot({ type: "png" })
|
|
862
285
|
```
|
|
863
286
|
|
|
864
|
-
Repeat the measure → fix → re-verify loop until
|
|
287
|
+
Repeat the measure → fix → re-verify loop until only Cosmetic and Accepted items remain.
|
|
865
288
|
|
|
866
289
|
### 5g: Accessibility Snapshot
|
|
867
290
|
|
|
@@ -879,22 +302,20 @@ Check that:
|
|
|
879
302
|
|
|
880
303
|
## Critical Rules
|
|
881
304
|
|
|
882
|
-
- **Phase 0 is not optional.** Never skip MCP verification, and establish which Figma MCP
|
|
883
|
-
|
|
884
|
-
- **
|
|
885
|
-
|
|
305
|
+
- **Phase 0 is not optional.** Never skip MCP verification, and establish which Figma MCP server is connected before Phase 1.
|
|
306
|
+
- **Classify provenance per instance (Phase 1f).** Do not assume the Indigo.Design kits. A third-party kit's names and variables are evidence to normalize, not to copy.
|
|
307
|
+
- **Never import from Code Connect of another library.** Code Connect snippets that point at shadcn, MUI, or an in-house package confirm the role only. The code is always Ignite UI.
|
|
308
|
+
- **Seed the palette from usage on Path B.** Use the color painted on the component, not the variable named `…/500`. On a `material` baseline, controls use `secondary`.
|
|
309
|
+
- **Ledger what tokens cannot fix; fix what they can.** Structural anatomy deltas go to the user in Phase 2d. Color, radius, casing, and height mismatches get fixed.
|
|
310
|
+
- **Phase 2b before code.** Never write a tag, attribute, or slot you have not read from a doc or API entry (or the skill reference file when no doc exists). Doc names are not tag names.
|
|
886
311
|
- **Register what you use.** An unregistered element fails silently.
|
|
887
|
-
- **Phase 1c screenshots are immutable ground truth.**
|
|
312
|
+
- **Phase 1c screenshots are immutable ground truth.** Save them; never overwrite them.
|
|
888
313
|
- **Re-navigate after resize** in Phase 5 to avoid Playwright's browser reset bug.
|
|
889
314
|
- **Respect the shadow boundary** — tokens and parts, never internal class names.
|
|
890
|
-
- **Match the theming output format to the project** — CSS by default, Sass only when
|
|
891
|
-
|
|
892
|
-
- **
|
|
893
|
-
|
|
894
|
-
- **Fail fast on 3 retries.** If the same correction fails three times, stop, report the
|
|
895
|
-
issue to the user, and ask for guidance.
|
|
896
|
-
- **Do not modify dependency manifests or lock files without asking.** Identify the exact
|
|
897
|
-
packages and versions required, then get approval before installing.
|
|
315
|
+
- **Match the theming output format to the project** — CSS by default, Sass only when configured.
|
|
316
|
+
- **Rate-limit Figma MCP calls.** Use `figma_get_metadata` for discovery, then targeted `figma_get_design_context` per artboard, and `figma_get_variable_defs` once per target page. On the desktop server, check that each response describes the requested artboard. When you rely on the selection, ask the user to select each artboard first and do not batch those calls.
|
|
317
|
+
- **Fail fast on 3 retries.** If the same correction fails three times, stop, report the issue to the user, and ask for guidance.
|
|
318
|
+
- **Do not modify dependency manifests or lock files without asking.** Identify the exact packages and versions required, then get approval before installing.
|
|
898
319
|
|
|
899
320
|
---
|
|
900
321
|
|