提交 de030335 编写于 作者: M Martin Aeschlimann

Theming: Bracket matching colors. Fixes #26104

上级 7e4dc211
......@@ -21,6 +21,9 @@ export const editorLineNumbers = registerColor('editorLineNumber.foreground', {
export const editorCodeLensForeground = registerColor('editorCodeLens.foreground', { dark: '#999999', light: '#999999', hc: '#999999' }, nls.localize('editorCodeLensForeground', 'Foreground color of editor code lenses'));
export const editorBracketMatchBackground = registerColor('editorBracketMatch.background', { dark: '#0064001a', light: '#0064001a', hc: '#0064001a' }, nls.localize('editorBracketMatchBackground', 'Background color behind matching brackets'));
export const editorBracketMatchBorder = registerColor('editorBracketMatch.border', { dark: '#888', light: '#B9B9B9', hc: '#fff' }, nls.localize('editorBracketMatchBorder', 'Color for matching brackets boxes'));
// contains all color rules that used to defined in editor/browser/widget/editor.css
registerThemingParticipant((theme, collector) => {
......
......@@ -4,9 +4,5 @@
*--------------------------------------------------------------------------------------------*/
.monaco-editor .bracket-match {
box-sizing: border-box;
background-color: rgba(0, 100, 0, 0.1);
}
.monaco-editor.vs .bracket-match { border: 1px solid #B9B9B9; }
.monaco-editor.vs-dark .bracket-match { border: 1px solid #888; }
.monaco-editor.hc-black .bracket-match { border: 1px solid #fff; }
......@@ -15,6 +15,8 @@ import * as editorCommon from 'vs/editor/common/editorCommon';
import { editorAction, commonEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
import { registerThemingParticipant } from "vs/platform/theme/common/themeService";
import { editorBracketMatchBackground, editorBracketMatchBorder } from "vs/editor/common/view/editorColorRegistry";
@editorAction
class SelectBracketAction extends EditorAction {
......@@ -204,3 +206,14 @@ export class BracketMatchingController extends Disposable implements editorCommo
this._lastVersionId = versionId;
}
}
registerThemingParticipant((theme, collector) => {
let bracketMatchBackground = theme.getColor(editorBracketMatchBackground);
if (bracketMatchBackground) {
collector.addRule(`.monaco-editor .bracket-match { background-color: ${bracketMatchBackground}; }`);
}
let bracketMatchBorder = theme.getColor(editorBracketMatchBorder);
if (bracketMatchBorder) {
collector.addRule(`.monaco-editor .bracket-match { border: 1px solid ${bracketMatchBorder}; }`);
}
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册