[bug] lint_design ignores hard-coded stroke colors that equal a variable (no warning, fix:true doesn't relink) #18

Closed
opened 2026-10-25 06:51:02 +00:00 by masi · 0 comments
Owner

Expected: lint_design reports a stroke/border written as a hex that equals a color variable (like it does for fills/text), and fix: true binds it to that variable.

Actual: Strokes (border, borderTop, etc.) with e.g. #e2e6df while --border = #e2e6df are not reported, and fix: true leaves them hex. After set_variable_mode to Dark every such border stays light. Lint reports 0 issues.

Repro:

  1. set_variables {mode:"Light", variables:{"border":"#e2e6df"}} and {mode:"Dark", variables:{"border":"#26302b"}}
  2. write_html <div style="border:1px solid #e2e6df;width:100px;height:40px"></div>
  3. lint_design {fix:true} → 0 issues, border still hex.
  4. set_variable_mode Dark → border stays #e2e6df.

Workaround: switch to the other mode, find_nodes {filters:[{styleName:"border", styleValue:"*#e2e6df*"}]} (and borderTop/Bottom/Left/Right separately), then bind_variable {field:"stroke"} in batches. Took ~1,100 nodes in one project.

Impact: Dark mode looks broken (light borders/dividers) while lint says the file is clean.


Filed from PaperCraft 0.7.2 (macos).

**Expected:** `lint_design` reports a stroke/border written as a hex that equals a color variable (like it does for fills/text), and `fix: true` binds it to that variable. **Actual:** Strokes (`border`, `borderTop`, etc.) with e.g. `#e2e6df` while `--border` = `#e2e6df` are not reported, and `fix: true` leaves them hex. After `set_variable_mode` to Dark every such border stays light. Lint reports 0 issues. **Repro:** 1. `set_variables {mode:"Light", variables:{"border":"#e2e6df"}}` and `{mode:"Dark", variables:{"border":"#26302b"}}` 2. `write_html` `<div style="border:1px solid #e2e6df;width:100px;height:40px"></div>` 3. `lint_design {fix:true}` → 0 issues, border still hex. 4. `set_variable_mode Dark` → border stays #e2e6df. **Workaround:** switch to the other mode, `find_nodes {filters:[{styleName:"border", styleValue:"*#e2e6df*"}]}` (and `borderTop/Bottom/Left/Right` separately), then `bind_variable {field:"stroke"}` in batches. Took ~1,100 nodes in one project. **Impact:** Dark mode looks broken (light borders/dividers) while lint says the file is clean. --- Filed from PaperCraft 0.7.2 (macos).
masi closed this issue 2026-10-25 06:58:58 +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#18