openpencil/packages/docs
Danila Poyarkov 4254204685
feat(dom-css): compile component variants into state styles (#965)
* feat(dom-css): compile component variants into state styles

Code export needs a component's variants as one markup tree whose look follows the control's state. stateStyles keeps the rest variant as the base and turns each other variant into only what it changes, under the data-state, data-disabled and interaction conditions Reka and Radix set, or a data attribute for other variant properties. Layers only some variants draw stay hidden where absent. stateStylesToCSS writes a stylesheet with readable classes and stateStylesToTailwind writes utilities behind state variants.

* refactor(dom-css): build state stylesheets with the CSS object model

The stylesheet was assembled from strings with JSON-quoted attribute values. It is now built with @acemir/cssom, which rejects an invalid selector and prints the declarations, and attribute values are escaped as CSS strings by cssesc. The object model loads lazily, as for font-face rules, so stateStylesToCSS is async.

* refactor(dom-css): split state styles by step and require a rest variant

model.ts mixed reading conditions, projecting and merging variants, and comparing styles. They now live in conditions.ts, layers.ts, and model.ts, with the types in types.ts. A layer only some variants draw keeps the style of the variant that adds it, so no separate first-style pass is needed. A set with no rest variant now has no state styles, instead of using a checked or hovered variant as its rest look.
2026-10-07 21:15:40 +00:00
..
.vitepress feat(ai): add guided AI setup for providers, coding agents, and Pi (#916) 2026-10-07 08:46:57 +00:00
de feat(storybook): give components with behaviours their own story controls (#961) 2026-10-07 20:06:17 +00:00
development feat(dom-css): compile component variants into state styles (#965) 2026-10-07 21:15:40 +00:00
es feat(storybook): give components with behaviours their own story controls (#961) 2026-10-07 20:06:17 +00:00
fr feat(collab): show MCP agents, follow streamed JSX, and follow your agents as they work (#725) 2026-10-07 10:04:58 +00:00
it feat(storybook): give components with behaviours their own story controls (#961) 2026-10-07 20:06:17 +00:00
overview feat: behaviours and preview mode (#893) 2026-10-06 13:23:05 +00:00
pl feat(collab): show MCP agents, follow streamed JSX, and follow your agents as they work (#725) 2026-10-07 10:04:58 +00:00
programmable feat(storybook): give components with behaviours their own story controls (#961) 2026-10-07 20:06:17 +00:00
public refactor(vue)!: remove the variables table composables (#908) 2026-10-06 12:35:41 +00:00
reference feat: behaviours and preview mode (#893) 2026-10-06 13:23:05 +00:00
ru feat(collab): show MCP agents, follow streamed JSX, and follow your agents as they work (#725) 2026-10-07 10:04:58 +00:00
user-guide feat(canvas): select auto layout frames by their gaps and dot their children, as in Figma (#943) 2026-10-07 11:29:52 +00:00
AGENTS.md build(tools): group tools by role and gate them like the rest of the repo (#791) 2026-09-30 05:00:31 +04:00
getting-started.md fix: explain unsupported browsers instead of a blank window (#745) 2026-09-22 14:40:59 +04:00
index.md Refine docs structure for SDK and automation 2026-03-24 23:24:08 +03:00
package.json build: update dependencies (#873) 2026-10-04 12:48:24 +00:00