antfu / windicss-runtime-dom

🪄 Enables Windi CSS for any site with one-line code without any build tools
https://windicss-runtime-dom.netlify.app/
MIT License
101 stars 7 forks source link

fix: only generate one style in head #1

Closed alexanderniebuhr closed 3 years ago

alexanderniebuhr commented 3 years ago

if script is injected in multiple components (needed for HMR in svelte) it would generate multiple style tags, since it is running multiple times. so check to if it exists, otherwise add it

antfu commented 3 years ago

I am thinking maybe it's better to make sure we have only have one instance of runtime-dom at a time

alexanderniebuhr commented 3 years ago

one instance of runtime-dom at a time

how would you check it?

UPDATE: nevermind, i just can check it myself