css

For all your CSS related content...
stephen 2015-11-13T17:30:18.000004Z

anyone know how to import styles from a css file in cljs? http://ai.github.io/postcss-way/?full#29

martinklepsch 2015-11-13T18:20:09.000005Z

@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?

stephen 2015-11-13T18:23:20.000006Z

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’;

stephen 2015-11-13T18:25:07.000010Z

but yea, referencing for sure

martinklepsch 2015-11-13T18:28:28.000011Z

when using plain JS are those files compiled to JS beforehand or does the import thing load and parse them at runtime?

stephen 2015-11-13T18:31:18.000013Z

I’m not entirely sure how that works in React.

stephen 2015-11-13T18:34:42.000014Z

this seems to explain it a bit more in depth https://github.com/gajus/react-css-modules

martinklepsch 2015-11-13T18:37:02.000016Z

It’s probably not going to be fun integrating that heavily webpack oriented workflow into a cljs app

stephen 2015-11-13T18:37:55.000017Z

ok I was looking for a native way to do this in cljs without any external tooling

stephen 2015-11-13T18:38:04.000018Z

if the files exist in the cljs project

martinklepsch 2015-11-13T18:40:38.000020Z

@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

stephen 2015-11-13T18:41:18.000021Z

ahh ok, I’ll check that out, thanks @martinklepsch

wildermuthn 2015-11-13T19:05:00.000022Z

@stephenway: have you taken a look at goog.cssom? https://google.github.io/closure-library/api/namespace_goog_cssom.html

stephen 2015-11-13T19:43:50.000023Z

@wildermuthn: Oh no, that looks promising!

wildermuthn 2015-11-13T19:45:01.000024Z

I’ve had a lot of success with it! Pretty interesting. I’d never heard of the cssom before.

stephen 2015-11-13T19:47:43.000025Z

I’m already using postcss for parsing, maybe this would be good passover just into a clojure app?