This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-13
Channels
- # beginners (67)
- # boot (18)
- # cider (28)
- # clara (11)
- # cljs-dev (1)
- # cljsrn (7)
- # clojure (134)
- # clojure-dev (2)
- # clojure-dusseldorf (1)
- # clojure-greece (1)
- # clojure-italy (13)
- # clojure-losangeles (2)
- # clojure-nl (2)
- # clojure-russia (2)
- # clojure-spec (2)
- # clojure-uk (52)
- # clojurebridge-ams (1)
- # clojurescript (78)
- # core-async (1)
- # core-matrix (2)
- # cursive (12)
- # data-science (22)
- # emacs (10)
- # events (1)
- # fulcro (28)
- # graphql (4)
- # hoplon (16)
- # jobs (1)
- # lein-figwheel (3)
- # leiningen (3)
- # nyc (1)
- # off-topic (19)
- # onyx (70)
- # parinfer (2)
- # pedestal (1)
- # portkey (9)
- # protorepl (2)
- # re-frame (16)
- # reagent (39)
- # ring-swagger (5)
- # rum (1)
- # schema (2)
- # shadow-cljs (216)
- # specter (5)
- # sql (1)
- # uncomplicate (4)
- # unrepl (6)
- # vim (25)
- # yada (5)
Hi! Is there a way to set some css psuedo classes selector in reagent node(.cljs file), in the :style
property? just want the code to do dynamic calculations on those psuedo-classes by operating clojurescript.
@cmal i don't think psuedo classes work in the :style property, but you can use garden (https://github.com/noprompt/garden) and add a dynamic [:style ...]
tag
@gadfly361 So I should generate css strings and add it to a style
tag, but where should the style
tag be put? If I put it under the #app
node, will it apply to the whole html page?
@cmal <style>
will always apply to whole page
@fingerzam ahh, Thank you!
doesn't <style>
need to appear in the header?
@cmal, this looks relevant to your use case https://github.com/roman01la/cljss
it's useful to read up on "styled components" in JS land (links in @roman01la's readme)
@pesterhazy cljss
is cool!
I have a feeling that styled components is the way to go for the future (i.e. more or less inline styles only)
it works very well for react native
thheller told me that https://github.com/thheller/shadow/wiki/shadow.markup might works for this, too.
@pesterhazy where did the injected css goes, for cljss
? in the <script>
tag in header?
I imagine so
report back if you like it
Why am I getting this create-react-class
error using reagent 0.7.0?
No such namespace: cljsjs.create-react-class, could not locate cljsjs/create_react_class.cljs, cljsjs/create_react_class.cljc, or JavaScript source providing "cljsjs.create-react-class"
OK, managed to get around this by adding an empty ns for it
fixed with: (ns cljsjs.create-react-class)
fixed with: (ns cljsjs.create-react-class)
@cmal Hi. cljss puts styles into a style tag in head
Also don’t forget to add {:closure-defines {“goog.DEBUG” false}} to compiler config when building for production to enable fast path
there’s also https://github.com/Jarzka/stylefy which is neat for reagent apps
component-path
depends on React internals so it won't work on React 16: https://github.com/reagent-project/reagent/blob/master/src/reagent/impl/component.cljs#L270
I wonder if it could be just removed, I think the only place it is used, is to show the path in error messages
Or maybe there is better way to implement this, without accessing internals
Bringing this up again, because I haven’t found a good way — does anyone know of an idiomatic way to extend a JS class in clojurescript? The java counterparts don’t seem to work well with es6 classes
@mikethompson Thx! I think I am confusing myself by sometimes testing this via Reagent. Just now in Reagent I managed to get a listener on a span tho the one on an input tag did not show. Anyway, thx again for confirming the React behavior.
@colindresj does this help? https://gist.github.com/pesterhazy/2a25c82db0519a28e415b40481f84554
Hello! Is there a way to turn a hiccup like data structure into a string with the html with reagent (or re-frame)?
@U3UDMF5ME could you tell to us with different words?
hiccup.core/html
Thanks for the replies. A bit unfortunate that I reagent can't do this, but I guess hiccups (the cljs thingy) is what I need. 🙂
hiccup.core/html