This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-08
Channels
- # aws (9)
- # beginners (69)
- # boot (14)
- # cider (26)
- # cljs-dev (56)
- # cljsrn (9)
- # clojars (4)
- # clojure (229)
- # clojure-brasil (1)
- # clojure-france (11)
- # clojure-greece (2)
- # clojure-italy (4)
- # clojure-mke (6)
- # clojure-serbia (6)
- # clojure-spec (83)
- # clojure-uk (38)
- # clojurescript (171)
- # core-async (3)
- # cursive (11)
- # data-science (11)
- # datomic (27)
- # emacs (113)
- # funcool (6)
- # hoplon (4)
- # jobs (1)
- # luminus (13)
- # lumo (44)
- # off-topic (148)
- # onyx (5)
- # overtone (1)
- # pedestal (4)
- # powderkeg (1)
- # proton (2)
- # re-frame (150)
- # reagent (16)
- # ring-swagger (43)
- # spacemacs (4)
- # specter (36)
- # vim (4)
- # yada (10)
What do you mean @minikomi
ah, I had a bunch of values which, if not nil, I wanted certain classes appended to the main wrapper to control css/appearance
ended up writing a macro, because some of the class names depended on the values being derefed (eg (name @background-type)
)
takes pairs of [predicate classname]
, builds a space separated string
I think you can apply a vector as :class, but would have to verify
oh really? then i could just do like (and @value (str "something-" (name @value)))
since and
short circuits..
You could use clojure.string/join and filter for nil? befote hand. Also the cond-> threading macro may be fun
For extra brevity use some->>
yeah i had that style originally, but thought there might be a more compact way to do it
Hmm too bad
Would be a nice enhancement though, maybe
https://github.com/yetanalytics/re-mdl/blob/master/src/cljc/re_mdl/components/button.cljc#L19
https://gist.github.com/minikomi/12175f0a315b0edc50d52e2f23765f14 what i ended up with