Remove old CSSX system — ~tw is the sole CSS engine

Phase 1 Step 1 of the architecture roadmap. The old cssx.sx
(cssx-resolve, cssx-process-token, cssx-template, old tw function)
is superseded by the ~tw component system in tw.sx.

- Delete shared/sx/templates/cssx.sx
- Remove cssx.sx from all load lists (sx_server.ml, run_tests.ml,
  mcp_tree.ml, compile-modules.js, bundle.sh, sx-build-all.sh)
- Replace (tw "tokens") inline style calls with (~tw :tokens "tokens")
  in layouts.sx and not-found.sx
- Remove _css-hash / init-css-tracking / SX-Css header plumbing
  (dead code — ~tw/flush + flush-collected-styles handle CSS now)
- Remove sx-css-classes param and meta tag from shell template
- Update stale data-cssx references to data-sx-css in tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 16:18:07 +00:00
parent 670295bf01
commit a64b693a09
17 changed files with 33 additions and 379 deletions

View File

@@ -117,7 +117,7 @@
build-request-headers
:effects (io)
(fn
(el (loaded-components :as list) (css-hash :as string))
(el (loaded-components :as list))
(let
((headers (dict "SX-Request" "true" "SX-Current-URL" (browser-location-href))))
(let
@@ -126,7 +126,6 @@
(let
((comp-hash (dom-get-attr (dom-query "script[data-components][data-hash]") "data-hash")))
(when comp-hash (dict-set! headers "SX-Components-Hash" comp-hash)))
(when css-hash (dict-set! headers "SX-Css" css-hash))
(let
((extra-h (dom-get-attr el "sx-headers")))
(when
@@ -162,8 +161,6 @@
(get-header "SX-Location")
"replace-url"
(get-header "SX-Replace-Url")
"css-hash"
(get-header "SX-Css-Hash")
"trigger-swap"
(get-header "SX-Trigger-After-Swap")
"trigger-settle"