openpencil/packages/cli
Danila Poyarkov 9bc353587f
refactor!: generate Tailwind JSX through dom-css (#763)
* refactor!: generate Tailwind JSX through dom-css

Core kept its own SceneGraph → Tailwind mapper next to the one dom-css
uses for Tailwind HTML, and the two drifted: HTML export turned grid
frames into flex columns and dropped rotation, inner shadows, blur, and
flex grow, while Tailwind JSX had them.

Tailwind JSX is now printed by dom-css from the same CSS projection as
HTML export, with esrap building the JSX and string literals carrying
text or attributes that JSX would otherwise reinterpret. The projection
gains grid layout and placement, rotation, every shadow, layer and
background blur, flex grow, right-to-left direction, and sections, and
writes opaque colors as hex so Tailwind can match its palette.

BREAKING CHANGE: `sceneNodeToJSX` and `selectionToJSX` in
`@open-pencil/core` no longer accept a format, and `JSXFormat` and
`JSXExportOptions` are removed. Use `sceneNodesToTailwindJSX` from
`@open-pencil/dom-css` or `@open-pencil/dom-css/browser`.

* fix(dom-css): keep backslashes and line breaks in Tailwind JSX attributes

JSX attribute strings keep backslashes literally, but the printer
escapes backslashes and line breaks in string literals, so a layer
named `a\b` came back as `a\\b`. Such values are now written as
expression containers, like values containing quotes or `&`.
2026-09-26 10:50:28 +04:00
..
bin build: publish node-compatible packages 2026-05-21 17:03:19 +03:00
src refactor!: generate Tailwind JSX through dom-css (#763) 2026-09-26 10:50:28 +04:00
tests feat: add Figma-style variants and component libraries (#512) 2026-08-14 19:31:41 +03:00
package.json Release v0.15.1 2026-09-18 16:33:46 +03:00
tsconfig.json feat(cli): import DOM/CSS documents 2026-06-30 10:48:13 +03:00
tsdown.config.ts feat: add Figma-style variants and component libraries (#512) 2026-08-14 19:31:41 +03:00