Last active
November 2, 2022 09:38
-
-
Save abearxiong/6df8d15dc40696ef285626323bef4dac to your computer and use it in GitHub Desktop.
system import css and import to root element.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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