Skip to content

Commit

Permalink
Add options store to capture all user tokens/config
Browse files Browse the repository at this point in the history
  • Loading branch information
dcostaras authored and oxalorg committed Aug 3, 2024
1 parent 8b061e1 commit 320999c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lambdaisland/ornament.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
props-registry
(atom {})))

#?(:clj
(defonce ^{:doc "Store of passed in custom options/tokens"}
options
(atom {:pretty-print? false})))

(def ^:dynamic *strip-prefixes*
"Prefixes to be stripped from class names in generated CSS"
nil)
Expand Down Expand Up @@ -148,6 +153,7 @@
:fonts (into (empty fonts)
(map (juxt (comp name key) val))
fonts)})]
(swap! options merge configuration)
(reset! girouette-api
(girouette/make-api
components
Expand Down Expand Up @@ -479,7 +485,7 @@
(into [(str "." (classname this))]
(process-rules rules)))
(css [this] (gc/compile-css
{:pretty-print? false}
{:pretty-print? (:pretty-print? @options)}
(as-garden this)))
(rules [_] rules)
(tag [_] tag)
Expand Down

0 comments on commit 320999c

Please sign in to comment.