Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build/vite/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="color-scheme" content="light dark">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Monaco Playground</title>
</head>
<body>
<div id="sampleContent"></div>
<p>Use the Playground Launch Config for a better dev experience</p>
Expand Down
8 changes: 8 additions & 0 deletions build/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ import './style.css';
import * as monaco from '../../src/vs/editor/editor.main';

globalThis.monaco = monaco;

// Enable automatic dark mode for accessibility.
const dark = matchMedia('(prefers-color-scheme: dark)');
monaco.editor.setTheme(dark.matches ? 'vs-dark' : 'vs-light');
dark.addEventListener('change', () => {
monaco.editor.setTheme(dark.matches ? 'vs-dark' : 'vs-light');
});

const root = document.getElementById('sampleContent');
if (root) {
const d = monaco.editor.createDiffEditor(root);
Expand Down