Skip to content

Instantly share code, notes, and snippets.

@abearxiong
Last active November 2, 2022 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abearxiong/6df8d15dc40696ef285626323bef4dac to your computer and use it in GitHub Desktop.
Save abearxiong/6df8d15dc40696ef285626323bef4dac to your computer and use it in GitHub Desktop.
system import css and import to root element.
const main = async () => {
const cssUrl = 'https://cdn.bootcdn.net/ajax/libs/tailwindcss/2.2.19/tailwind.min.css';
const lib = await System.import(cssUrl)
if(lib && lib.default) {
root.adoptedStyleSheets = [...root.adoptedStyleSheets, lib.default]
}
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment