Codegen: FRAME nodes without `fill` (and the root frame) keep an unbound white default fill — no "no fill" syntax
Summary
Two related codegen behaviours in bridge-ds compile (7.3.1) leave unbound, hardcoded white fills in the generated design, contradicting the "no hardcoded values" guarantee:
- FRAME nodes without a
fillfield keep Figma's default fill.figma.createFrame()creates a frame with a solid#FFFFFFfill. Codegen only emitsframe.fills = mf(var)when the scene graph declaresfill; otherwise nothing is emitted, so the frame stays opaque white and unbound. Layout wrapper frames (a "Form" column, a "Heading" stack, an "Actions" row) are therefore white in dark mode. - The compiler-generated root frame (
root = figma.createFrame(); root.name = …; root.resize(…)) has the same default white fill, and the scene graph has no way to address it (nometadata.fill).
There is also no syntax for "no fill" in the scene graph — fill is a string token or absent — so the only compliant workaround is to bind every wrapper frame to a surface token ($color/bg/surface), which is semantically wrong for transparent wrappers and still leaves the root frame white.
Reproduction
Scene graph:
{ "type": "FRAME", "name": "Form", "layout": "VERTICAL", "gap": "$spacing/4", "fillH": true,
"children": [ { "type": "INSTANCE", "name": "Email", "component": "Forms/Input Field" } ] }
After execution, Form.fills = [{ type: "SOLID", color: {1,1,1} }] with no boundVariables. Same for the root LoginScreen frame.
Checked with a snapshot script listing every node whose paint has no boundVariables.color: only these compiler-created defaults show up; every declared token is bound correctly.
Proposal
- Emit
frame.fills = []for every FRAME (including the root) that has nofillin the scene graph — a wrapper frame should be transparent by default. - Optionally accept
"fill": "none"explicitly, andmetadata.fill(a$token) for the root frame. - Consider the same for
strokes(frames have none by default, so no change needed there) and for RECTANGLE/ELLIPSE which default to grey#D9D9D9whenfillis omitted.
This would remove the last class of unbound paints from compiler output. Happy to send a PR.