Skip to content

Commit 83b528d

Browse files
authored
Move css rules for microsoft#165169 (microsoft#165595)
* microsoft#165169 Move css rules from diffReview.ts into diffReview.css * microsoft#165169 Move css rules from scrollDecoration.ts into scrollDecoration.css * microsoft#165169 Move css rules from diffReview.ts into diffReview.css * microsoft#165169 Move css rules from accessibilityHelp.ts into accessibilityHelp.css * remove useless import * microsoft#165169 Move css rules from BracketMatch.ts into BracketMatch.css
1 parent b149a6d commit 83b528d

File tree

8 files changed

+13
-62
lines changed

8 files changed

+13
-62
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
top: 0;
99
left: 0;
1010
height: 6px;
11-
}
11+
box-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;
12+
}

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import { ViewPart } from 'vs/editor/browser/view/viewPart';
99
import { RenderingContext, RestrictedRenderingContext } 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 { scrollbarShadow } from 'vs/platform/theme/common/colorRegistry';
13-
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
1412
import { EditorOption } from 'vs/editor/common/config/editorOptions';
1513

1614

@@ -91,10 +89,3 @@ export class ScrollDecorationViewPart extends ViewPart {
9189
this._domNode.setClassName(this._shouldShow ? 'scroll-decoration' : '');
9290
}
9391
}
94-
95-
registerThemingParticipant((theme, collector) => {
96-
const shadow = theme.getColor(scrollbarShadow);
97-
if (shadow) {
98-
collector.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${shadow} 0 6px 6px -6px inset; }`);
99-
}
100-
});

src/vs/editor/browser/widget/diffReview.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ import { LineTokens } from 'vs/editor/common/tokens/lineTokens';
2222
import { Position } from 'vs/editor/common/core/position';
2323
import { ScrollType } from 'vs/editor/common/editorCommon';
2424
import { ITextModel, TextModelResolvedOptions } from 'vs/editor/common/model';
25-
import { editorLineNumbers } from 'vs/editor/common/core/editorColorRegistry';
2625
import { RenderLineInput, renderViewLine2 as renderViewLine } from 'vs/editor/common/viewLayout/viewLineRenderer';
2726
import { ViewLineRenderingData } from 'vs/editor/common/viewModel';
2827
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
2928
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
30-
import { scrollbarShadow } from 'vs/platform/theme/common/colorRegistry';
31-
import { registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService';
29+
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
3230
import { Constants } from 'vs/base/common/uint';
3331
import { Codicon } from 'vs/base/common/codicons';
3432
import { registerIcon } from 'vs/platform/theme/common/iconRegistry';
@@ -817,18 +815,6 @@ export class DiffReview extends Disposable {
817815

818816
// theming
819817

820-
registerThemingParticipant((theme, collector) => {
821-
const lineNumbers = theme.getColor(editorLineNumbers);
822-
if (lineNumbers) {
823-
collector.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${lineNumbers}; }`);
824-
}
825-
826-
const shadow = theme.getColor(scrollbarShadow);
827-
if (shadow) {
828-
collector.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${shadow} 0 -6px 6px -6px inset; }`);
829-
}
830-
});
831-
832818
class DiffReviewNext extends EditorAction {
833819
constructor() {
834820
super({

src/vs/editor/browser/widget/media/diffReview.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.monaco-diff-editor .diff-review-line-number {
77
text-align: right;
88
display: inline-block;
9+
color: var(--vscode-editorLineNumber-foreground);
910
}
1011

1112
.monaco-diff-editor .diff-review {
@@ -20,6 +21,7 @@
2021

2122
.monaco-diff-editor .diff-review-shadow {
2223
position: absolute;
24+
box-shadow: var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset;
2325
}
2426

2527
.monaco-diff-editor .diff-review-row {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55

66
.monaco-editor .bracket-match {
77
box-sizing: border-box;
8+
background-color: var(--vscode-editorBracketMatch-background);
9+
border: var(--vscode-editorBracketMatch-border);
810
}

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ import { IEditorContribution, IEditorDecorationsCollection } from 'vs/editor/com
1717
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
1818
import { IModelDeltaDecoration, OverviewRulerLane, TrackedRangeStickiness } from 'vs/editor/common/model';
1919
import { ModelDecorationOptions } from 'vs/editor/common/model/textModel';
20-
import { editorBracketMatchBackground, editorBracketMatchBorder } from 'vs/editor/common/core/editorColorRegistry';
2120
import * as nls from 'vs/nls';
2221
import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
2322
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
2423
import { registerColor } from 'vs/platform/theme/common/colorRegistry';
25-
import { registerThemingParticipant, themeColorFromId } from 'vs/platform/theme/common/themeService';
24+
import { themeColorFromId } from 'vs/platform/theme/common/themeService';
2625

2726
const overviewRulerBracketMatchForeground = registerColor('editorOverviewRuler.bracketMatchForeground', { dark: '#A0A0A0', light: '#A0A0A0', hcDark: '#A0A0A0', hcLight: '#A0A0A0' }, nls.localize('overviewRulerBracketMatchForeground', 'Overview ruler marker color for matching brackets.'));
2827

@@ -360,16 +359,6 @@ export class BracketMatchingController extends Disposable implements IEditorCont
360359
registerEditorContribution(BracketMatchingController.ID, BracketMatchingController);
361360
registerEditorAction(SelectToBracketAction);
362361
registerEditorAction(JumpToBracketAction);
363-
registerThemingParticipant((theme, collector) => {
364-
const bracketMatchBackground = theme.getColor(editorBracketMatchBackground);
365-
if (bracketMatchBackground) {
366-
collector.addRule(`.monaco-editor .bracket-match { background-color: ${bracketMatchBackground}; }`);
367-
}
368-
const bracketMatchBorder = theme.getColor(editorBracketMatchBorder);
369-
if (bracketMatchBorder) {
370-
collector.addRule(`.monaco-editor .bracket-match { border: 1px solid ${bracketMatchBorder}; }`);
371-
}
372-
});
373362

374363
// Go to menu
375364
MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {

src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@
77
padding: 10px;
88
vertical-align: middle;
99
overflow: scroll;
10-
}
10+
color: var(--vscode-editorWidget-foreground);
11+
background-color: var(--vscode-editorWidget-background);
12+
box-shadow: 0 2px 8px var(--vscode-widget-shadow);
13+
border: 2px solid var(--vscode-contrastBorder);
14+
}

src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati
2626
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
2727
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
2828
import { IOpenerService } from 'vs/platform/opener/common/opener';
29-
import { contrastBorder, editorWidgetBackground, widgetShadow, editorWidgetForeground } from 'vs/platform/theme/common/colorRegistry';
30-
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
3129
import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
3230
import { AccessibilityHelpNLS } from 'vs/editor/common/standaloneStrings';
3331
import { EditorOption } from 'vs/editor/common/config/editorOptions';
@@ -362,25 +360,3 @@ registerEditorCommand(
362360
}
363361
})
364362
);
365-
366-
registerThemingParticipant((theme, collector) => {
367-
const widgetBackground = theme.getColor(editorWidgetBackground);
368-
if (widgetBackground) {
369-
collector.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${widgetBackground}; }`);
370-
}
371-
const widgetForeground = theme.getColor(editorWidgetForeground);
372-
if (widgetForeground) {
373-
collector.addRule(`.monaco-editor .accessibilityHelpWidget { color: ${widgetForeground}; }`);
374-
}
375-
376-
377-
const widgetShadowColor = theme.getColor(widgetShadow);
378-
if (widgetShadowColor) {
379-
collector.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`);
380-
}
381-
382-
const hcBorder = theme.getColor(contrastBorder);
383-
if (hcBorder) {
384-
collector.addRule(`.monaco-editor .accessibilityHelpWidget { border: 2px solid ${hcBorder}; }`);
385-
}
386-
});

0 commit comments

Comments
 (0)