Consolidate CSSX docs: add delivery page, remove old CSS docs and plan
Moved on-demand CSS delivery protocol from docs/css into /cssx/delivery, framed as one strategy among several. Removed the CSSX Components plan (now redundant with the top-level /cssx/ section). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -85,28 +85,6 @@
|
||||
"Forms marked with a tail position enable " (a :href "/essays/tco" :class "text-violet-600 hover:underline" "tail-call optimization") " — recursive calls in tail position use constant stack space.")
|
||||
(div :class "space-y-10" forms))))
|
||||
|
||||
(defcomp ~docs-css-content ()
|
||||
(~doc-page :title "On-Demand CSS"
|
||||
(~doc-section :title "How it works" :id "how"
|
||||
(p :class "text-stone-600"
|
||||
"sx scans every response for CSS class names used in :class attributes. It looks up only those classes in a pre-parsed Tailwind CSS registry and ships just the rules that are needed. No build step. No purging. No unused CSS.")
|
||||
(p :class "text-stone-600"
|
||||
"On the first page load, the full set of used classes is embedded in a <style> block. A hash of the class set is stored. On subsequent navigations, the client sends the hash in the SX-Css header. The server computes the diff and sends only new rules via SX-Css-Add and a <style data-sx-css> block."))
|
||||
(~doc-section :title "The protocol" :id "protocol"
|
||||
(~doc-code :code (highlight "# First page load:\nGET / HTTP/1.1\n\nHTTP/1.1 200 OK\nContent-Type: text/html\n# Full CSS in <style id=\"sx-css\"> + hash in <meta name=\"sx-css-classes\">\n\n# Subsequent navigation:\nGET /about HTTP/1.1\nSX-Css: a1b2c3d4\n\nHTTP/1.1 200 OK\nContent-Type: text/sx\nSX-Css-Hash: e5f6g7h8\nSX-Css-Add: bg-blue-500,text-white,rounded-lg\n# Only new rules in <style data-sx-css>" "bash")))
|
||||
(~doc-section :title "Advantages" :id "advantages"
|
||||
(ul :class "space-y-2 text-stone-600"
|
||||
(li "Zero build step — no Tailwind CLI, no PostCSS, no purging")
|
||||
(li "Exact CSS — never ships a rule that isn't used on the page")
|
||||
(li "Incremental — subsequent navigations only ship new rules")
|
||||
(li "Component-aware — pre-scans component definitions at registration time")))
|
||||
(~doc-section :title "Disadvantages" :id "disadvantages"
|
||||
(ul :class "space-y-2 text-stone-600"
|
||||
(li "Requires the full Tailwind CSS file loaded in memory at startup (~4MB parsed)")
|
||||
(li "Regex-based class scanning — can miss dynamically constructed class names")
|
||||
(li "No @apply support — classes must be used directly")
|
||||
(li "Tied to Tailwind's utility class naming conventions")))))
|
||||
|
||||
(defcomp ~docs-server-rendering-content ()
|
||||
(~doc-page :title "Server Rendering"
|
||||
(~doc-section :title "Python API" :id "python"
|
||||
|
||||
Reference in New Issue
Block a user