diff --git a/dev/hiccup/src/dev/hiccup.clj b/dev/hiccup/src/dev/hiccup.clj index baa635a..55f9414 100644 --- a/dev/hiccup/src/dev/hiccup.clj +++ b/dev/hiccup/src/dev/hiccup.clj @@ -32,13 +32,14 @@ (defn page [] (str + "\n" (h/html [:html [:head [:meta {:charset "utf-8"}] [:meta {:name "viewport" :content "width=device-width, initial-scale=1"}] [:link {:rel "stylesheet" :href "/theme.css"}] - [:style "body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; padding: 2rem; background: var(--bg-0); color: var(--fg-0); margin: 0; transition: background-color 0.2s, color 0.2s; }"]] + [:style (h/raw "body { padding: 2rem; }")]] [:body [:div {:style "max-width: 800px; margin: 0 auto;"} [:div {:style "display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem;"} diff --git a/dev/replicant/public/index.html b/dev/replicant/public/index.html index 15e569c..ddaf44c 100644 --- a/dev/replicant/public/index.html +++ b/dev/replicant/public/index.html @@ -5,14 +5,7 @@ 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."