vuejs / repl

Vue SFC REPL as a Vue 3 component
https://repl-vuejs.vercel.app
MIT License
930 stars 172 forks source link

fix: 🐛 change css loading sequence #80

Closed xxholly32 closed 1 year ago

xxholly32 commented 1 year ago

change css loading sequence sfc url

from

<style id="__sfc-styles">.test {
    color: red;
};@import "https://unpkg.com/element-plus@2/dist/index.css";</style>

to

<style id="__sfc-styles">@import "https://unpkg.com/element-plus@2/dist/index.css";.test {
    color: red;
};</style>

closes https://github.com/vuejs/repl/issues/79

xxholly32 commented 1 year ago

This may not be the best solution because other sfc files also import css-urls; One solution is to do it all together and the good thing is to do it all together and the bad thing is to think about a lot of things

Another is the option to add css to the import map file, like this, which has the benefit of decoupling the import and the disadvantage of adding a new mental burden