You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extend the framework-builtin recognizer to the font-weight named scale.
Projects almost never declare font weights in @theme (you just write
font-bold), yet designs routinely tokenize them — so weight/* otherwise
reads as a false 'unmapped' gap. The step is a font-style name mapped to
Tailwind's font-weight utility (the one rename is Regular → normal; also
absorbs Semi Bold / ExtraLight / Heavy spelling variants). builtin.scale is
'font-weight' → the model emits font-{step}.
Recognizer is now two-kind: open-ended numeric stems (spacing, line-height)
and the fixed font-weight name map. Still fallback-only and conservative —
an unknown weight name (e.g. Condensed) stays unmapped, gated on
profile.styling.system === 'tailwind'.
Live-verified against 客戶 X: weight/Bold→font-bold, weight/Regular→font-normal,
weight/Medium→font-medium; token_map unmapped now 6, all genuine. 531 tests.
- candidate.unmatchedProps are props the design needs but the component lacks → surface them as component-extension TODOs, never fake them with ad-hoc markup.
25
25
- unmapped: build it new in the project's style. For a repeated unmapped component (instanceCount > 1, e.g. a table row), build from its first instance's subtree; drill instances[0].nodeId if it was scoped away.
26
26
27
-
3. token_map — every Figma variable joined to a project token. Reference candidate.ref (e.g. bg-primary-500 or var(--color-primary-500)), never the raw hex/px. A 'framework-builtin' status (Tailwind built-in scale, e.g. spacing/4, line-height/7) carries builtin.{scale,step}: for spacing compose the step with the bound property (p-4 / gap-4 / m-4), for line-height use leading-{step} (leading-7) — use the utility, not an arbitrary p-[16px], and don't report it as a gap. Only a genuinely 'unmapped' variable is a gap — use the value but call it out, don't hardcode it silently.
27
+
3. token_map — every Figma variable joined to a project token. Reference candidate.ref (e.g. bg-primary-500 or var(--color-primary-500)), never the raw hex/px. A 'framework-builtin' status (Tailwind built-in scale, e.g. spacing/4, line-height/7, weight/Bold) carries builtin.{scale,step}: for spacing compose the step with the bound property (p-4 / gap-4 / m-4), for line-height use leading-{step} (leading-7), for font-weight use font-{step} (font-bold) — use the utility, not an arbitrary p-[16px], and don't report it as a gap. Only a genuinely 'unmapped' variable is a gap — use the value but call it out, don't hardcode it silently.
28
28
29
29
4. get_screenshot (or save_screenshots to write straight to disk) — export the assets grounding can't encode. Logos, photos, and icons have no pixels in the layout tree and otherwise render as grey blocks, often half the visible surface. For each visual-only leaf — a node with an IMAGE fill (a photo), a VECTOR / boolean-op, or an icon instance (e.g. mainComponent.name under Icons/…) — export it (SVG for vector/icon, PNG scale 2 for photos) into the project's asset dir and import the real file. Logos and brand marks are always exported, never typed by hand.
0 commit comments