anyone know how to import styles from a css file in cljs? http://ai.github.io/postcss-way/?full#29
@stephenway: do you have an existing set of css files that you’d like to import or are you just interested in replicating the same architecture?
I have existing css files and I’d like to load them into each cljs component in the same manner as i’m using PostCSS like import styles from ‘./component.css’;
but yea, referencing for sure
when using plain JS are those files compiled to JS beforehand or does the import thing load and parse them at runtime?
I’m not entirely sure how that works in React.
this seems to explain it a bit more in depth https://github.com/gajus/react-css-modules
It’s probably not going to be fun integrating that heavily webpack oriented workflow into a cljs app
ok I was looking for a native way to do this in cljs without any external tooling
if the files exist in the cljs project
@stephenway: there’s no plug and play solution. I guess you could come up with something based on garden
that reads css files and generates appropriate cljs namespaces
ahh ok, I’ll check that out, thanks @martinklepsch
@stephenway: have you taken a look at goog.cssom? https://google.github.io/closure-library/api/namespace_goog_cssom.html
@wildermuthn: Oh no, that looks promising!
I’ve had a lot of success with it! Pretty interesting. I’d never heard of the cssom before.
I’m already using postcss for parsing, maybe this would be good passover just into a clojure app?