diff options
Diffstat (limited to 'bundle/src/editor.js')
| -rw-r--r-- | bundle/src/editor.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bundle/src/editor.js b/bundle/src/editor.js index 853fa82..58b0e19 100644 --- a/bundle/src/editor.js +++ b/bundle/src/editor.js @@ -33,7 +33,10 @@ export const theme = { tokenColors: [{ settings: { foreground: dark.colors['editor.foreground'], background: dark.colors['editor.background'] } }, ...dark.tokenColors] }; -for (const [key, value] of Object.entries(dark.colors)) document.documentElement.style.setProperty(`--vscode-${key.replaceAll('.', '-')}`, value); +export const themeVariable = key => `--vscode-${key.replaceAll('.', '-')}`; +// VS Code falls back to its terminal defaults when a theme leaves terminal.ansi* unset. +const colors = { ...parse(sources['../vendor/vscode/terminal-colors.json']).colors, ...dark.colors }; +for (const [key, value] of Object.entries(colors)) document.documentElement.style.setProperty(themeVariable(key), value); class TokenState { constructor(stack) { this.stack = stack; } |
