From 6b4899f8bfe4e6ec2985fa7b1f4bf747cd588a73 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Tue, 3 Mar 2026 11:04:27 +0100 Subject: [PATCH] refactor: centralize body base styles in theme.css Move font-family, background, color, margin, and transition from duplicated inline diff --git a/dev/squint/index.html b/dev/squint/index.html index 61be3db..9ebaf95 100644 --- a/dev/squint/index.html +++ b/dev/squint/index.html @@ -5,14 +5,7 @@ diff --git a/src/ui/css/gen.clj b/src/ui/css/gen.clj index 86b3bde..ba1ae82 100644 --- a/src/ui/css/gen.clj +++ b/src/ui/css/gen.clj @@ -21,6 +21,17 @@ (map (fn [[k v]] (str " " (token->css-var k) ": " v ";"))) (str/join "\n"))) +(defn base-css + "Generate base body/reset styles." + [] + "body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; + margin: 0; + background: var(--bg-0); + color: var(--fg-0); + transition: background-color 0.2s, color 0.2s; +}") + (defn component-css-button "Generate BEM-lite CSS for the button component." [] @@ -94,8 +105,9 @@ " :root:not([data-theme=\"light\"]) {\n" (str/replace (tokens->css-block dark-tokens) #"(?m)^ " " ") "\n }\n}") + base (base-css) components (component-css-button)] - (str/join "\n\n" [root-block dark-attr dark-media components ""]))) + (str/join "\n\n" [root-block dark-attr dark-media base components ""]))) (defn build-theme! "Read tokens from file and write generated CSS to output."