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:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user