On Friday, 6 November 2015 07:24:59 UTC-5, Dhruv Bhatia wrote: > Hi All, > > Curious to know whether anyone has successfully built a CLJS workflow for > using CSS Modules within Clojurescript: > > http://glenmaddern.com/articles/css-modules > > It looks like a really solid way to write maintainable CSS, but I haven't > been able to find any references to Clojure based workflows. > > I'm specifically interested in understanding how one can include CSS modules > within CLJS where we don't have a bundle tool like Browserify to also process > the CLJS file itself. > > I'm thinking about using something like Gulp to build and watch my css files, > outputting a bundle which I can then reference within my CLJS file - but not > sure whether that will work as the JS examples seem to "import" the CSS > modules directly in order to get the references to the style names. > > Will give it a go and see where I get, but any thoughts would be appreciated.
Good news - I managed to get this working using a Gulp/Browserify compile process which builds a CommonJS module that is consumed by my CLJS project (using foreign-libs). I can then use the generated CSS Module class names within my CLJS files. It works with live-reloading through figwheel too, so quite happy. There were a few quirks with getting it all working, so If anyone is interested, I can clean up the code and create a sample GitHub project. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
