Hi everyone! Does anyone know what's the best way ...
# compose-web
n
Hi everyone! Does anyone know what's the best way to load a CSS stylesheet from a NPM dependency in Kotlin WASM? I have a mixed UI using Compose WASM for most of the UI and some HTML content as well and I need to load a CSS from a npm dependency. I did try a few solutions but none worked. The one that seemed more fit was using
@JSModule
and
@JSNonModule
on the css file to load it from Kotlin code, but JSNonModule is not available on WASM target. Right now my workaround is loading the CSS manually on HTML from a CDN, but I'd rather have everything packed. I already enabled CSS on build.gradle. Thanks!
r
It depends what kind of JS module configuration do you use. If you have
useEsModules()
-
@JsModule
should work.
👍 1
n
awesome!
appreciate the help @Robert Jaros