This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-14
Channels
- # adventofcode (2)
- # announcements (61)
- # babashka (26)
- # beginners (125)
- # calva (63)
- # cider (33)
- # clj-kondo (40)
- # cljs-dev (24)
- # clojure (165)
- # clojure-australia (8)
- # clojure-dev (4)
- # clojure-europe (44)
- # clojure-finland (1)
- # clojure-greece (4)
- # clojure-losangeles (1)
- # clojure-nl (28)
- # clojure-taiwan (3)
- # clojure-uk (64)
- # clojurescript (2)
- # core-async (14)
- # datomic (34)
- # docker (2)
- # fulcro (9)
- # garden (1)
- # jobs (4)
- # jobs-discuss (21)
- # kaocha (3)
- # off-topic (48)
- # pathom (4)
- # practicalli (3)
- # remote-jobs (3)
- # shadow-cljs (46)
- # spacemacs (6)
- # sql (4)
- # tools-deps (22)
- # xtdb (5)
- # yada (2)
I've done it so that I have a defclass
macro that has clj and cljs variants.
In CLJ (i.e. when running lein garden)
(ns my-style-namespace)
(defclass warning
{:color :red})
;; expands to
;; #=> (def warning [".my_style_namespace_warning" {:color :red}])
And in CLJS (when referencing the style from React/Reagent component)
(ns my-style-namespace)
(defclass warning
{:color :red})
;; expands to
;; #=> (def warning "my_style_namespace_warning")
This has been working fine for me but if I understood right you're not using CLJS but hiccup in CLJ, you need to figure out another way to decide which variant to use.