7

I have a styles.css file and I need to load it from a cljs to pass it as a props to a react lib.

The import in node is:

import styles from './styles.css'

Is it possible to do this in ClojureScript with shadow-cljs?

akond
  • 15,865
  • 4
  • 35
  • 55
ivangalbans
  • 470
  • 5
  • 14

1 Answers1

7

Importing styles.css in webpack is handled by the style-loader which you can sort of hook up by following the webpack guide and exporting things to global objects.

ClojureScript itself (or shadow-cljs) does not support anything in that regard but you could possibly create something similar using macros.

Thomas Heller
  • 3,842
  • 1
  • 9
  • 9
  • 3
    No, not currently. I wrote an alternative in [shadow.markup](https://github.com/thheller/shadow/wiki/shadow.markup) which functions similarly to the `styled-components` library but it isn't documented very well. There are other alternatives using the `garden` clojure lib. – Thomas Heller Mar 24 '19 at 16:22