File tree Expand file tree Collapse file tree 4 files changed +2418
-6
lines changed Expand file tree Collapse file tree 4 files changed +2418
-6
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ onMounted(async () => {
4848
4949 // create a Monaco editor instance
5050 editor .value = monaco .createEditor (editorRef .value , {
51- // theme: ui.colorMode.value === 'light' ? 'vs ' : 'vs -dark',
51+ theme: ui .colorMode .value === ' light' ? ' vitesse-light ' : ' vitesse -dark' ,
5252 lineNumbers: ' off' ,
5353 readOnly: props .readOnly ,
5454 scrollbar: props .readOnly
@@ -92,11 +92,11 @@ onMounted(async () => {
9292 editor .value .setModel (monaco .editor .createModel (content .value , ' mdc' ))
9393
9494 // Set the theme based on the color mode
95- // watch(ui.colorMode, () => {
96- // editor.value?.updateOptions({
97- // theme: ui.colorMode.value === 'light' ? 'vs ' : 'vs -dark',
98- // })
99- // })
95+ watch (ui .colorMode , () => {
96+ editor .value ?.updateOptions ({
97+ theme: ui .colorMode .value === ' light' ? ' vitesse-light ' : ' vitesse -dark' ,
98+ })
99+ })
100100})
101101
102102function setContent(document : DatabasePageItem ) {
Original file line number Diff line number Diff line change 11import { createSingletonPromise } from '@vueuse/core'
22import type { editor as Editor } from 'modern-monaco/editor-core'
3+ import themeLight from './theme-light'
4+ import themeDark from './theme-dark'
35
46export { setupSuggestion } from './mdc-compilation'
57export type { editor as Editor } from 'modern-monaco/editor-core'
@@ -20,6 +22,8 @@ export const setupMonaco = createSingletonPromise(async () => {
2022 }
2123
2224 const monaco : Monaco = await init ( )
25+ monaco . editor . defineTheme ( 'vitesse-light' , themeLight )
26+ monaco . editor . defineTheme ( 'vitesse-dark' , themeDark )
2327
2428 return {
2529 monaco,
You can’t perform that action at this time.
0 commit comments