Fork me on GitHub
Richard Bowen04:08:30

How does one reference the ::before selector using Reagent?

Asko Nōmm05:08:33

Afaik, Reagent creates inline styles and pseudo-selectors cannot be targeted via inline styles.

Richard Bowen05:08:52

I see. Thanks.


If you want to apply css styles programmatically with cljs, you can do so conveniently with a tool like 🌿 or ♠️ - both use :female-farmer: syntax


Hey all, I'm trying to compile a clojurescript form within clojurescript, by defining a macro in a .clj file

(ns my-worker.helpers
  (:require [cljs.closure :as cljs]))
(defmacro compile-cljs [form] (cljs/build [form] {:optimizations :simple :pretty-print true}))
and then calling it from my .cljs file
(def x (helpers/compile-cljs '[
                              (.log js/console "hello")]))
while this def would work totally fine in the .clj file, it fails in the clojurescript file with the message
; clojure.lang.ExceptionInfo: Namespace declarations must appear at the top-level. at line 9
Why does that happen?


had a coworker require [cljs.js :as js] because he was using js/JSON. Wanted to ask questions about that. I know it is unnecessary, but is it really even allowed? I thought the namespace js was special and the compiler did its thing so i'm surprised it allowed an alias of that


@dpsutton hrm I suppose we could warn


because any such alias will always be shadowed


ok i thought that was my understanding


awesome. thanks @dnolen


@ottenjonas not sure what you are attempting - if that could work x would be a string


yes that's what I want! (just using the def as an example here, but basically want to compile a form at compile time to js)


it interestingly enough works totally fine when I use the macro as a top-level form

(ns my-worker.core)

(helpers/compile-cljs '[(.log js/console "hello")])
but with the example I mentioned it throws the error


is there a reason why an error would not happen on the top-level form?