cljss icon indicating copy to clipboard operation
cljss copied to clipboard

`inject-global` accepts functions?

Open teotenn opened this issue 1 year ago • 0 comments

Is there a possibility to apply a function to generate the hash map with styles into inject-global?

For example

(defn head-css [s w]
  {:font-family (css-fonts :header)
   :font-size (str s "rem")
   :font-weight (* w 100)})

(inject-global
 {
  :h1 (head-css 2 9)
  :h2 (head-css 1.8 8)
 })

Does not work. Or am I missing some other function/macro that can help me modify styles with a similar approach?

teotenn avatar Aug 21 '24 14:08 teotenn