Skip to content

Commit 320999c

Browse files
dcostarasoxalorg
authored andcommitted
Add options store to capture all user tokens/config
1 parent 8b061e1 commit 320999c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lambdaisland/ornament.cljc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
props-registry
4747
(atom {})))
4848

49+
#?(:clj
50+
(defonce ^{:doc "Store of passed in custom options/tokens"}
51+
options
52+
(atom {:pretty-print? false})))
53+
4954
(def ^:dynamic *strip-prefixes*
5055
"Prefixes to be stripped from class names in generated CSS"
5156
nil)
@@ -148,6 +153,7 @@
148153
:fonts (into (empty fonts)
149154
(map (juxt (comp name key) val))
150155
fonts)})]
156+
(swap! options merge configuration)
151157
(reset! girouette-api
152158
(girouette/make-api
153159
components
@@ -479,7 +485,7 @@
479485
(into [(str "." (classname this))]
480486
(process-rules rules)))
481487
(css [this] (gc/compile-css
482-
{:pretty-print? false}
488+
{:pretty-print? (:pretty-print? @options)}
483489
(as-garden this)))
484490
(rules [_] rules)
485491
(tag [_] tag)

0 commit comments

Comments
 (0)