This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-10
Channels
- # announcements (1)
- # babashka (178)
- # beginners (216)
- # bootstrapped-cljs (1)
- # brompton (5)
- # calva (3)
- # chlorine-clover (1)
- # clj-kondo (2)
- # cljdoc (37)
- # cljfx (4)
- # cljs-dev (2)
- # clojure (360)
- # clojure-chile (8)
- # clojure-europe (3)
- # clojure-italy (5)
- # clojure-nl (9)
- # clojure-spec (2)
- # clojure-sweden (1)
- # clojure-uk (61)
- # clojuredesign-podcast (1)
- # clojurescript (83)
- # clr (2)
- # conjure (4)
- # core-async (14)
- # cursive (20)
- # data-science (2)
- # datomic (15)
- # docker (11)
- # emotion-cljs (1)
- # figwheel-main (28)
- # find-my-lib (1)
- # fulcro (46)
- # helix (16)
- # honeysql (14)
- # jobs (10)
- # jobs-discuss (17)
- # joker (1)
- # juxt (9)
- # kaocha (8)
- # leiningen (3)
- # meander (3)
- # news-and-articles (1)
- # off-topic (110)
- # pathom (7)
- # pedestal (4)
- # protojure (2)
- # re-frame (12)
- # reagent (25)
- # ring (4)
- # shadow-cljs (109)
- # spacemacs (9)
- # specter (1)
- # sql (3)
- # tools-deps (23)
> one thing I like about what we use at work is we add the namespace to the generated class name
@lilactown yes, you can do it use label
option in Emotion, please check it https://github.com/khmelevskii/emotion-cljs#labels
in dev mode? good idea!
@fabrao > Oh, if I can only use Button instead of antd/Button I can call Button as `MyButton` , right? Thank you I use something like this
// badge.styled.cljs
(defstyled <Badge> :div ;; antd/Badge in your case
{:display :inline-flex
:align-items :center
:border-radius 12})
// badge.core.cljs
(defnc <Badge>
[{:keys [class-name
size
view
children]}]
{:default default-props
:spec ::spec/props}
($ styled/<Badge> {:class-name class-name
:size size
:view view})
children)
I think that I will add small example with helix to the repo
@y.khmelevskii clj-commons/cljss
not refresh with helix
I don’t have any issues with reloading helix component
No, I will create it
@fabrao #emotion-cljs
(ns app.core
(:require
["react-dom" :as rdom]
[helix.dom :as d]
[helix.core :as hx :refer [$]]
["antd/es/button" :default Button]
[emotion.core :refer [defstyled]]
[app.lib :refer [defnc]]))
(defstyled Div d/div
{:color :red})
(defnc App []
($ Div "Fernando"))
(defn ^:export start
[]
(rdom/render ($ App)
(js/document.getElementById "app")))
What I´m doing wrong?
(defstyled Div d/div
----------------------^---------------------------------------------------------
Can't take value of macro helix.dom/div
--------------------------------------------------------------------------------
11 | {:color :red})
d/div is a macro around the native :div element, so just use :div. Not that you'll lose some preprocessing by the macro though - namely these special handling https://github.com/lokeh/helix/blob/0.0.12/src/helix/impl/props.cljc#L156-L160
I solved with this
(defstyled Div "div"
{:color :red})
(defnc App []
($ Div "Fernando"))
also you can use keyword :div
d/div is a macro around the native :div element, so just use :div. Not that you'll lose some preprocessing by the macro though - namely these special handling https://github.com/lokeh/helix/blob/0.0.12/src/helix/impl/props.cljc#L156-L160