CSSX rules from island SSR: flush collected rules via ~cssx/flush in shell

Added (~cssx/flush) to shell after sx-root div — picks up CSS rules
generated during island SSR via (collect! "cssx" ...). Registered
clear-collected! primitive for the flush component.

Standard CSSX classes now styled server-side. Custom colour shades
(e.g. text-violet-699) still need investigation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 14:53:31 +00:00
parent 6e1d28d1d7
commit f3c0cbd8e2
2 changed files with 12 additions and 0 deletions

View File

@@ -68,6 +68,8 @@ details.group{overflow:hidden}details.group>summary{list-style:none}details.grou
(body :class "bg-stone-50 text-stone-900"
;; Server-rendered HTML — visible immediately before JS loads
(div :id "sx-root" (raw! (or body-html "")))
;; Flush CSSX rules collected during island SSR
(~cssx/flush)
(script :type "text/sx" :data-components true :data-hash component-hash
(raw! (or component-defs "")))
(when init-sx