openpencil/packages/docs/programmable/cli
Danila Poyarkov fb0cb9ee5f
feat: write variable-bound properties as tokens in exported code (#895)
* feat: write variable-bound properties as tokens in exported code

HTML and Tailwind JSX export reference the design tokens a layer is bound to, var(--color-primary) or bg-primary, instead of baking in their values. A binding becomes a reference only where the stylesheet resolves it as the canvas draws it: the layer still draws the value, the token's unit fits the property, and an attribute such as data-theme="dark" can put the element in the layer's mode. Standalone HTML includes the stylesheet for the tokens it uses, compiled into Tailwind's @theme for Tailwind pages.

* refactor: share the collection variable list and tighten token helpers

Read every variable in collection order through one collectionVariables helper built on es-toolkit's compact, used by the stylesheet and the token references, and map padding sides and color channels instead of repeating them.
2026-10-05 09:15:44 +00:00
..
analyzing.md docs(cli): use released openpencil command 2026-05-29 15:56:52 +03:00
app-control.md feat: control documents, history, settings, and tools from the CLI and MCP (#871) 2026-10-04 16:02:36 +00:00
comparing.md feat: add visual diff and patch apply tools and openpencil diff (#810) 2026-10-03 21:00:13 +04:00
exporting.md feat: write variable-bound properties as tokens in exported code (#895) 2026-10-05 09:15:44 +00:00
inspecting.md feat: control documents, history, settings, and tools from the CLI and MCP (#871) 2026-10-04 16:02:36 +00:00
scripting.md feat: create, fill, and edit slots (#862) 2026-10-04 17:02:28 +00:00