Skip to content

Commit d34224b

Browse files
Kalmaegiaeschli
andauthored
Move css rules from inPlaceReplace.ts into inPlaceReplace.css (microsoft#166098)
* microsoft#165169 Move css rules from inPlaceReplace.ts into inPlaceReplace.css * microsoft#165169 Move css rules from ghostTextWidget.ts into ghostTextWidget.css * microsoft#165169 Move css rules from links.ts into links.css * microsoft#165169 Move css rules from findOptionsWidget.ts into findOptionsWidget.css * 💄 * supplement missing attributes for findOptionsWidget.css * 💄 * 💄 * 💄 * Revert "💄" This reverts commit 776684d. * 💄 * rm the wrong assignment Co-authored-by: Martin Aeschlimann <[email protected]>
1 parent ee76340 commit d34224b

File tree

5 files changed

+19
-34
lines changed

5 files changed

+19
-34
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
7+
.monaco-editor.vs .valueSetReplacement {
8+
outline: solid 2px var(--vscode-editorBracketMatch-border);
9+
}

src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
1616
import { ModelDecorationOptions } from 'vs/editor/common/model/textModel';
1717
import { IInplaceReplaceSupportResult } from 'vs/editor/common/languages';
1818
import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker';
19-
import { editorBracketMatchBorder } from 'vs/editor/common/core/editorColorRegistry';
2019
import * as nls from 'vs/nls';
2120
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
22-
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
2321
import { InPlaceReplaceCommand } from './inPlaceReplaceCommand';
22+
import 'vs/css!./inPlaceReplace';
2423

2524
class InPlaceReplaceController implements IEditorContribution {
2625

@@ -181,9 +180,3 @@ registerEditorContribution(InPlaceReplaceController.ID, InPlaceReplaceController
181180
registerEditorAction(InPlaceReplaceUp);
182181
registerEditorAction(InPlaceReplaceDown);
183182

184-
registerThemingParticipant((theme, collector) => {
185-
const border = theme.getColor(editorBracketMatchBorder);
186-
if (border) {
187-
collector.addRule(`.monaco-editor.vs .valueSetReplacement { outline: solid 2px ${border}; }`);
188-
}
189-
});

src/vs/editor/contrib/inlineCompletions/browser/ghostText.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,11 @@
3636
text-decoration: underline;
3737
text-underline-position: under;
3838
}
39+
40+
.monaco-editor .ghost-text-decoration,
41+
.monaco-editor .ghost-text-decoration-preview,
42+
.monaco-editor .suggest-preview-text .ghost-text {
43+
color: var(--vscode-editorGhostText-foreground) !important;
44+
background-color: var(--vscode-editorGhostText-background);
45+
border: 1px solid var(--vscode-editorGhostText-border);
46+
}

src/vs/editor/contrib/inlineCompletions/browser/ghostTextWidget.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ import { StringBuilder } from 'vs/editor/common/core/stringBuilder';
1717
import { IModelDeltaDecoration, InjectedTextCursorStops, PositionAffinity } from 'vs/editor/common/model';
1818
import { ILanguageIdCodec } from 'vs/editor/common/languages';
1919
import { ILanguageService } from 'vs/editor/common/languages/language';
20-
import { ghostTextBackground, ghostTextBorder, ghostTextForeground } from 'vs/editor/common/core/editorColorRegistry';
2120
import { LineDecoration } from 'vs/editor/common/viewLayout/lineDecorations';
2221
import { RenderLineInput, renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer';
2322
import { InlineDecorationType } from 'vs/editor/common/viewModel';
2423
import { GhostTextReplacement, GhostTextWidgetModel } from 'vs/editor/contrib/inlineCompletions/browser/ghostText';
2524
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
26-
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
2725

2826
const ttPolicy = window.trustedTypes?.createPolicy('editorGhostText', { createHTML: value => value });
2927

@@ -437,26 +435,3 @@ class ViewMoreLinesContentWidget extends Disposable implements IContentWidget {
437435
}
438436
}
439437

440-
registerThemingParticipant((theme, collector) => {
441-
const foreground = theme.getColor(ghostTextForeground);
442-
if (foreground) {
443-
// `!important` ensures that other decorations don't cause a style conflict (#132017).
444-
collector.addRule(`.monaco-editor .ghost-text-decoration { color: ${foreground.toString()} !important; }`);
445-
collector.addRule(`.monaco-editor .ghost-text-decoration-preview { color: ${foreground.toString()} !important; }`);
446-
collector.addRule(`.monaco-editor .suggest-preview-text .ghost-text { color: ${foreground.toString()} !important; }`);
447-
}
448-
449-
const background = theme.getColor(ghostTextBackground);
450-
if (background) {
451-
collector.addRule(`.monaco-editor .ghost-text-decoration { background-color: ${background.toString()}; }`);
452-
collector.addRule(`.monaco-editor .ghost-text-decoration-preview { background-color: ${background.toString()}; }`);
453-
collector.addRule(`.monaco-editor .suggest-preview-text .ghost-text { background-color: ${background.toString()}; }`);
454-
}
455-
456-
const border = theme.getColor(ghostTextBorder);
457-
if (border) {
458-
collector.addRule(`.monaco-editor .suggest-preview-text .ghost-text { border: 1px solid ${border}; }`);
459-
collector.addRule(`.monaco-editor .ghost-text-decoration { border: 1px solid ${border}; }`);
460-
collector.addRule(`.monaco-editor .ghost-text-decoration-preview { border: 1px solid ${border}; }`);
461-
}
462-
});

src/vs/editor/contrib/links/browser/links.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
.monaco-editor .detected-link-active {
77
text-decoration: underline;
88
text-underline-position: under;
9-
color: var(--vscode-editorLink-activeForeground) !important;
109
}
1110

1211
.monaco-editor .detected-link-active {
1312
cursor: pointer;
13+
color: var(--vscode-editorLink-activeForeground) !important;
1414
}

0 commit comments

Comments
 (0)