UI component functions like page-center, page-title, text-muted, and card
take an attrs map followed by child elements. When nested, function-call style
indentation (aligning with first argument) wastes horizontal space.
;; Function-call style (wastes horizontal space)
(page-center {:class "foo"}
[:h1 "Title"]
[:p "Body"])Align subsequent arguments with the first argument. Standard for most function calls but creates deep nesting with wrapper components.
Treat the first argument as special (like a binding vector in let) and indent
body forms 2 spaces from the opening paren. Used by defn, let, when,
with-open, and similar forms.
Non-standard. No precedent in Clojure ecosystem.
Use body-style indentation with 2-space indent for UI component functions.
(page-center {:class "foo"}
[:h1 "Title"]
[:p "Body"])This matches the Clojure community standard for body forms and is consistent with
defn, let, when, with-open, and other macros. Configured via:
.cljfmt.ednwith:extra-indentsusing[[:block 1]].dir-locals.elwithdefine-clojure-indentusing1
- Reduced horizontal nesting when composing UI components
- Consistent with standard Clojure indentation conventions
- Requires configuration in both cljfmt and Emacs for full tooling support
- New UI component functions need to be added to both configuration files