File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -4,14 +4,28 @@ import Toast from './components/utils/Toast.vue'
44import { shallowRef , onMounted , onUnmounted } from ' vue'
55// vitepress SSR does not support Monaco, lazy load on client side
66let playground = shallowRef <unknown >(null )
7+
8+ // setup global style
9+ import styles from ' ./style.css?inline'
10+ const styleId = ' playground-style'
11+ function insertStyle() {
12+ const style = document .createElement (' style' )
13+ style .id = styleId
14+ style .textContent = styles
15+ document .head .appendChild (style )
16+ }
17+
718onMounted (async () => {
819 // apply playground style override, see style.css
20+ insertStyle ()
921 document .body .classList .add (' playground' )
1022 playground .value = (await import (' ./components/Playground.vue' )).default
1123})
1224onUnmounted (() => {
13- // apply playground style override, see style.css
25+ // remove playground style override
1426 document .body .classList .remove (' playground' )
27+ const style = document .getElementById (styleId )
28+ style ?.remove ()
1529})
1630 </script >
1731
@@ -35,8 +49,6 @@ onUnmounted(() => {
3549 </div >
3650</template >
3751
38- <style src="./style.css "/>
39-
4052<style scoped>
4153.logo {
4254 height : 9em ;
Original file line number Diff line number Diff line change @@ -9,9 +9,6 @@ import Toolbars from './Toolbars.vue'
99import EnvDisplay from ' ./EnvDisplay.vue'
1010import { initializeParser , useAstGrep , Mode as ModeImport } from ' ./astGrep'
1111
12- // setup global style
13- import ' ../style.css'
14-
1512// important initialization
1613await initializeParser ()
1714
You can’t perform that action at this time.
0 commit comments