Skip to content

Commit a9eeb47

Browse files
author
Orta
authored
Merge pull request #187 from microsoft/dark
Adds dark mode to the site
2 parents 00e4f74 + 7207c0b commit a9eeb47

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+704
-147
lines changed

packages/sandbox/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createCompilerHost } from './createCompilerHost'
22
import { detectNewImportsToAcquireTypeFor } from './typeAcquisition'
3-
import { sandboxTheme } from './theme'
3+
import { sandboxTheme, sandboxThemeDark } from './theme'
44
import { TypeScriptWorker } from './tsWorker'
55
import {
66
getDefaultSandboxCompilerOptions,
@@ -105,6 +105,7 @@ export const createTypeScriptSandbox = (
105105

106106
const model = monaco.editor.createModel(defaultText, language, filePath)
107107
monaco.editor.defineTheme('sandbox', sandboxTheme)
108+
monaco.editor.defineTheme('sandbox-dark', sandboxThemeDark)
108109
monaco.editor.setTheme('sandbox')
109110

110111
const monacoSettings = Object.assign({ model }, sharedEditorOptions, config.monacoSettings || {})

packages/sandbox/src/theme.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
const blue = '3771EF'
22
const darkerBlue = '1142AF'
3-
const darkestBlue = '09235D'
4-
5-
const yellow = 'F3DF51'
6-
const darkYellow = 'AEA811'
7-
const darkerYellow = '65610A'
83

94
const grey = '84864d'
10-
const green = '12CD0E'
115
const greenDark = '10990D'
126
const greenLight = '54F351'
137

@@ -69,3 +63,18 @@ export const sandboxTheme: import('monaco-editor').editor.IStandaloneThemeData =
6963
editorSelectionHighlight: '#ADD6FF4D',
7064
},
7165
}
66+
67+
export const sandboxThemeDark: import('monaco-editor').editor.IStandaloneThemeData = {
68+
base: 'vs-dark',
69+
inherit: true,
70+
rules: [
71+
{ token: 'constant', foreground: '44ee11' },
72+
{ token: 'comment', foreground: grey },
73+
{ token: 'number', foreground: greenDark },
74+
{ token: 'regexp', foreground: greenLight },
75+
{ token: 'type', foreground: darkerBlue },
76+
],
77+
colors: {
78+
// 'editor.background': '#313131',
79+
},
80+
}

0 commit comments

Comments
 (0)