[bug] get_design_spec compact writes bound strokes as hex #23

Closed
opened 2026-10-25 22:51:23 +00:00 by masi · 1 comment
Owner

Version/context: PaperCraft (2026-10-25 build), design-system page with a colour variable border (Light #e2e6df, Dark #26302b)
Expected: get_design_spec {format:"compact"} writes a bound stroke as its variable, like fills and radii do (border=--border/1).
Actual: it writes the resolved hex (border=#e2e6df/1) although get_computed_styles on the same node returns border: 1px solid var(--border), and bind_variable {field:"stroke", variable:"border"} succeeds. Fills (bg=--card) and radii (r=--radius) export as variables.
Repro: a frame with border:1px solid var(--border) → papercraft-cli call bind_variable '{"nodeIds":["<id>"],"field":"stroke","variable":"border"}' → papercraft-cli call get_design_spec '{"nodeId":"<id>","format":"compact"}' shows border=#e2e6df/1.
Workaround: check strokes with get_computed_styles; code maps the hex to the token by hand.
Impact: design-to-code: every frozen spec looks like it has raw border colours (63 on one design-system page), so agents report false "unbound border" gaps and Dark mode looks unhandled.

**Version/context:** PaperCraft (2026-10-25 build), design-system page with a colour variable `border` (Light #e2e6df, Dark #26302b) **Expected:** `get_design_spec {format:"compact"}` writes a bound stroke as its variable, like fills and radii do (`border=--border/1`). **Actual:** it writes the resolved hex (`border=#e2e6df/1`) although `get_computed_styles` on the same node returns `border: 1px solid var(--border)`, and `bind_variable {field:"stroke", variable:"border"}` succeeds. Fills (`bg=--card`) and radii (`r=--radius`) export as variables. **Repro:** a frame with `border:1px solid var(--border)` → `papercraft-cli call bind_variable '{"nodeIds":["<id>"],"field":"stroke","variable":"border"}'` → `papercraft-cli call get_design_spec '{"nodeId":"<id>","format":"compact"}'` shows `border=#e2e6df/1`. **Workaround:** check strokes with `get_computed_styles`; code maps the hex to the token by hand. **Impact:** design-to-code: every frozen spec looks like it has raw border colours (63 on one design-system page), so agents report false "unbound border" gaps and Dark mode looks unhandled.
masi closed this issue 2026-10-27 21:02:26 +00:00
Author
Owner

Fixed in 75faf3e on branch debrand.

Fixed in 75faf3e on branch debrand.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: masi/papercraft#23