We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e4de92 commit b534eeaCopy full SHA for b534eea
examples/demo/src/index.ts
@@ -102,10 +102,15 @@ formatting: Formatting is supported too! Under the hood this is powered by
102
103
`.replace(/:$/m, ': ')
104
105
+const dark = matchMedia('(prefers-color-scheme: dark)')
106
+editor.setTheme(dark.matches ? 'vs-dark' : 'vs-light')
107
+dark.addEventListener('change', () => {
108
+ editor.setTheme(dark.matches ? 'vs-dark' : 'vs-light')
109
+})
110
+
111
const ed = editor.create(document.getElementById('editor')!, {
112
automaticLayout: true,
113
model: editor.createModel(value, 'yaml', Uri.parse('monaco-yaml.yaml')),
- theme: window.matchMedia('(prefers-color-scheme: dark)').matches ? 'vs-dark' : 'vs-light',
114
quickSuggestions: {
115
other: true,
116
comments: false,
0 commit comments