shadow-cljs

Shantanu Kumar 2025-04-27T11:52:17.504019Z

Hi, is there any updated (2025) answer how to import styles from './styles.css' using shadow-cljs? Ref: https://stackoverflow.com/questions/55308431/how-to-load-css-files-in-clojurescript-project-with-shadow-cljs

thheller 2025-04-27T13:02:12.310839Z

to answer that I'd need to understand what import styles from './styles.css' means to you. because it can mean a million different things

thheller 2025-04-27T13:02:25.700279Z

but basically the answer is still the same. shadow-cljs does not support css in any way

Shantanu Kumar 2025-04-27T13:06:01.941409Z

OK, in a specific case I am using Bootstrap5 and want to just do the equivalent of import 'bootstrap/dist/css/bootstrap.css' in a React19 app with UIx. (As a workaround, I'm linking to the CDN version in index.html directly.)

thheller 2025-04-27T13:08:52.887529Z

ok, there is no support for that. could technically be done in a build hook

thheller 2025-04-27T13:09:01.747629Z

maybe I should create a reference example for that 😛

Shantanu Kumar 2025-04-27T13:10:27.823829Z

I saw an example how to do that with Tailwind: https://github.com/kaepr/game-of-life-cljs/blob/main/package.json#L8 but no idea how to do a similar thing with Bootstrap - I tried creating a similar build script but boostrap dosn't seem to have a similar support.

thheller 2025-04-27T13:14:36.179429Z

define similar thing

thheller 2025-04-27T13:14:44.592159Z

this is just a css file, it doesn't need building of any kind

thheller 2025-04-27T13:14:56.249609Z

a literal copy is enough?

thheller 2025-04-27T13:15:45.211419Z

import 'bootstrap/dist/css/bootstrap.css' the file for this is located in node_modules/bootstrap/dist/css/bootstrap.css

thheller 2025-04-27T13:15:54.883629Z

copy it whereever you like and use it, it is probably the exact file you get from the CDN

thheller 2025-04-27T13:16:29.538539Z

they also have a .min.css if you want something smaller

Shantanu Kumar 2025-04-27T13:17:28.085439Z

> a literal copy is enough? ... Yes, for now. I will follow the copy approach, thanks.

thheller 2025-04-27T13:18:03.081909Z

if you add a second file just concat them together 😛

👍🏽 1