Skip to content

Commit

Permalink
Fixes microsoft/monaco-editor#2660: If available, create a rule for d…
Browse files Browse the repository at this point in the history
…efault tokens using the `editor.foreground` and `editor.background` colors
  • Loading branch information
alexdima committed Nov 9, 2021
1 parent d258720 commit 5a0d538
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ class StandaloneTheme implements IStandaloneTheme {
encodedTokensColors = baseData.encodedTokensColors;
}
}
// Pick up default colors from `editor.foreground` and `editor.background` if available
const editorForeground = this.themeData.colors['editor.foreground'];
const editorBackground = this.themeData.colors['editor.background'];
if (editorForeground || editorBackground) {
const rule: ITokenThemeRule = { token: '' };
if (editorForeground) {
rule.foreground = editorForeground;
}
if (editorBackground) {
rule.background = editorBackground;
}
rules.push(rule);
}
rules = rules.concat(this.themeData.rules);
if (this.themeData.encodedTokensColors) {
encodedTokensColors = this.themeData.encodedTokensColors;
Expand Down

0 comments on commit 5a0d538

Please sign in to comment.