We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9cc864 commit 2b58e11Copy full SHA for 2b58e11
1 file changed
packages/repl/src/lib/workers/bundler/index.ts
@@ -376,11 +376,13 @@ async function get_bundle(
376
}
377
);
378
// add the CSS via injecting a style tag
379
+ const style_id = result.css.code.match(/\.svelte-([a-z0-9]+)/)?.[0]?.slice(1) ?? ('svelte-' + name.replace(/[^a-zA-Z0-9]/g, '_'));
380
result.js.code +=
381
'\n\n' +
382
`
383
import { styles as $$_styles } from '${VIRTUAL}/${STYLES}';
384
const $$__style = document.createElement('style');
385
+ $$__style.id = ${JSON.stringify(style_id)};
386
$$__style.textContent = ${JSON.stringify(result.css.code)};
387
document.head.append($$__style);
388
$$_styles.push($$__style);
0 commit comments