refactor: replace BEM with utility classes, move component CSS to files

- Rename CSS classes from BEM double-dash (btn--primary) to flat
  utility-style single-dash (btn-primary)
- Move button CSS from inline Clojure string in gen.clj to
  src/ui/button.css next to button.cljc
- gen.clj now auto-collects all src/ui/*.css files via babashka.fs glob
- Replace clojure.java.io with babashka.fs throughout gen.clj
- Update AGENTS.md to reflect new conventions
This commit is contained in:
Florian Schroedl
2026-03-03 11:11:47 +01:00
parent 6b4899f8bf
commit 988617617c
6 changed files with 123 additions and 118 deletions

View File

@@ -11,12 +11,12 @@
(defn button-class-list
"Generate a vector of CSS class strings for a button given variant and size.
Returns e.g. [\"btn\" \"btn--primary\" \"btn--lg\"]."
Returns e.g. [\"btn\" \"btn-primary\" \"btn-lg\"]."
[{:keys [variant size]}]
(let [v (or (some-> variant kw-name) default-variant)
s (or (some-> size kw-name) default-size)]
(cond-> ["btn" (str "btn--" v)]
(not= s "md") (conj (str "btn--" s)))))
(cond-> ["btn" (str "btn-" v)]
(not= s "md") (conj (str "btn-" s)))))
(defn button-classes
"Generate CSS class string for a button. Returns a space-joined string."