Skip to content

Commit da44da2

Browse files
jkei0Joni Keinänenalexdima
authored
Move css rules from selections.ts to selections.css (microsoft#166407)
* Move css rules from selections.ts to selections.css * Move back rule from CSS to TypeScript Co-authored-by: Joni Keinänen <[email protected]> Co-authored-by: Alex Dima <[email protected]>
1 parent 71a1a02 commit da44da2

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/vs/editor/browser/viewParts/selections/selections.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
position: absolute;
1212
}
1313

14+
.monaco-editor .focused .selected-text {
15+
background-color: var(--vscode-editor-selectionBackground);
16+
}
17+
18+
.monaco-editor .selected-text {
19+
background-color: var(--vscode-editor-inactiveSelectionBackground);
20+
}
21+
1422
.monaco-editor .top-left-radius { border-top-left-radius: 3px; }
1523
.monaco-editor .bottom-left-radius { border-bottom-left-radius: 3px; }
1624
.monaco-editor .top-right-radius { border-top-right-radius: 3px; }

src/vs/editor/browser/viewParts/selections/selections.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Range } from 'vs/editor/common/core/range';
99
import { HorizontalRange, LineVisibleRanges, RenderingContext } from 'vs/editor/browser/view/renderingContext';
1010
import { ViewContext } from 'vs/editor/common/viewModel/viewContext';
1111
import * as viewEvents from 'vs/editor/common/viewEvents';
12-
import { editorInactiveSelection, editorSelectionBackground, editorSelectionForeground } from 'vs/platform/theme/common/colorRegistry';
12+
import { editorSelectionForeground } from 'vs/platform/theme/common/colorRegistry';
1313
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
1414
import { EditorOption } from 'vs/editor/common/config/editorOptions';
1515

@@ -403,14 +403,6 @@ export class SelectionsOverlay extends DynamicViewOverlay {
403403
}
404404

405405
registerThemingParticipant((theme, collector) => {
406-
const editorSelectionColor = theme.getColor(editorSelectionBackground);
407-
if (editorSelectionColor) {
408-
collector.addRule(`.monaco-editor .focused .selected-text { background-color: ${editorSelectionColor}; }`);
409-
}
410-
const editorInactiveSelectionColor = theme.getColor(editorInactiveSelection);
411-
if (editorInactiveSelectionColor) {
412-
collector.addRule(`.monaco-editor .selected-text { background-color: ${editorInactiveSelectionColor}; }`);
413-
}
414406
const editorSelectionForegroundColor = theme.getColor(editorSelectionForeground);
415407
if (editorSelectionForegroundColor && !editorSelectionForegroundColor.isTransparent()) {
416408
collector.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${editorSelectionForegroundColor}; }`);

0 commit comments

Comments
 (0)