Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 364
ivangalbans Avatar asked Mar 22 '19 22:03

ivangalbans


1 Answers

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.

like image 106
Thomas Heller Avatar answered Oct 08 '22 13:10

Thomas Heller