This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Hi! It possible to use the css
macro like this:
(defmacro defstyles [name & rules]
(-> (apply hash-map rules)
(update-vals (fn [rule] (css rule))))
what would be the intent there? don't quite understand what this would be supposed to do
No problem. Just a convenient macro instead of:
(def styles
{:foo/container (css {:color "red" :width "600px"})
:baz/container (css {...})
Do this:
(defstyles styles
:foo/container {:color "red" :width "600px"}
:baz/container {...})
well, you could do that with the macro. the issue is that the build tooling only currently detects (css ...)
forms
https://github.com/thheller/shadow-css/blob/main/src/main/shadow/css/analyzer.cljc#L275-L311
I do want to make that extensible at some point, just didn't spend any time thinking about it so far