[bug] update_styles accepts border: var(--x) but freezes hex; bindings invisible in reads #20

Closed
opened 2026-10-25 08:00:39 +00:00 by masi · 0 comments
Owner

Expected: update_styles {border: "1px solid var(--border)"} either binds the stroke to the variable or lists it under ignoredStyles. Reads (get_computed_styles, get_jsx, find_nodes) show var(--border) on bound strokes, as they do for fills.
Actual: The call returns success and stores the resolved hex. After bind_variable {field: "stroke"} reads still show #e2e6df, so you can't tell bound strokes from unbound ones, or verify the binding without switching modes. find_nodes also caps at 500 results without saying more exist.
Repro: set_variables border=#cccccc (Light) / #333333 (Dark); write_html <div style="width:100px;height:40px;border:1px solid #ccc"/>; update_styles border 1px solid var(--border); get_computed_styles → hex; set_variable_mode Dark → border stays #ccc.
Workaround: bind_variable stroke per node, then check by switching modes.
Impact: Theme migrations look done but aren't; large pages need per-artboard queries.


Filed from PaperCraft 0.7.2 (macos).

**Expected:** `update_styles {border: "1px solid var(--border)"}` either binds the stroke to the variable or lists it under `ignoredStyles`. Reads (`get_computed_styles`, `get_jsx`, `find_nodes`) show `var(--border)` on bound strokes, as they do for fills. **Actual:** The call returns success and stores the resolved hex. After `bind_variable {field: "stroke"}` reads still show `#e2e6df`, so you can't tell bound strokes from unbound ones, or verify the binding without switching modes. `find_nodes` also caps at 500 results without saying more exist. **Repro:** set_variables border=#cccccc (Light) / #333333 (Dark); write_html `<div style="width:100px;height:40px;border:1px solid #ccc"/>`; update_styles border `1px solid var(--border)`; get_computed_styles → hex; set_variable_mode Dark → border stays #ccc. **Workaround:** bind_variable stroke per node, then check by switching modes. **Impact:** Theme migrations look done but aren't; large pages need per-artboard queries. --- Filed from PaperCraft 0.7.2 (macos).
masi closed this issue 2026-10-25 15:33:50 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: masi/papercraft#20