Import an external CSS in a popup

Seems like the only way to import Svelte Material UI is by using <link>: https://sveltematerialui.com/INSTALL.md What's the way to import in a popup?
Svelte Material UI
Material UI Components for Svelte, ready to use in your app.
2 Replies
Avi
AviOP•2y ago
So far, the only way I found is
<script lang="ts">
import smuiCss from "data-text:../node_modules/svelte-material-ui/bare.css";
const elStyle = document.createElement("style");
elStyle.textContent = smuiCss;
document.head.append(elStyle);
</script>
<script lang="ts">
import smuiCss from "data-text:../node_modules/svelte-material-ui/bare.css";
const elStyle = document.createElement("style");
elStyle.textContent = smuiCss;
document.head.append(elStyle);
</script>
Which looks very awkward An ideal solution instead:
<link rel="stylesheet" href="../node_modules/svelte-material-ui/bare.css">
<link rel="stylesheet" href="../node_modules/svelte-material-ui/bare.css">
lab
lab•2y ago
Hmm I thought you can just do import "bare.css"
Want results from more Discord servers?
Add your server