ivangalbans
ivangalbans

Reputation: 500

How to load css files in ClojureScript project with shadow-cljs

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?

Upvotes: 7

Views: 3167

Answers (1)

Thomas Heller
Thomas Heller

Reputation: 4356

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.

Upvotes: 7

Related Questions