Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subtle borders to widgets #167773

Merged
merged 8 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,6 @@
"titleBar.inactiveBackground": "#1f1f1f",
"titleBar.inactiveForeground": "#8b949e",
"welcomePage.tileBackground": "#ffffff0f",
"widgetBorder": "#ffffff15",
},
}
1 change: 1 addition & 0 deletions extensions/theme-defaults/themes/dark_vs.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"tab.lastPinnedBorder": "#ccc3",
"list.activeSelectionIconForeground": "#FFF",
"terminal.inactiveSelectionBackground": "#3A3D41",
"widget.border": "#303031",
},
"tokenColors": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,6 @@
"titleBar.inactiveBackground": "#f8f8f8",
"titleBar.inactiveForeground": "#8b949e",
"welcomePage.tileBackground": "#f3f3f3",
"wdgetBorder": "#0000001a",
},
}
1 change: 1 addition & 0 deletions extensions/theme-defaults/themes/light_vs.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"list.activeSelectionIconForeground": "#FFF",
"list.focusAndSelectionOutline": "#90C2F9",
"terminal.inactiveSelectionBackground": "#E5EBF1",
"widget.border": "#d4d4d4"
},
"tokenColors": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/parts/quickinput/browser/media/quickInput.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
right: 0;
margin: 0 auto;
-webkit-app-region: no-drag;
border-radius: 4px;
border-radius: 6px;
}

.quick-input-titlebar {
Expand Down
6 changes: 3 additions & 3 deletions src/vs/base/parts/quickinput/browser/quickInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export interface IQuickInputWidgetStyles {
quickInputBackground?: Color;
quickInputForeground?: Color;
quickInputTitleBackground?: Color;
contrastBorder?: Color;
widgetBorder?: Color;
widgetShadow?: Color;
}

Expand Down Expand Up @@ -1816,13 +1816,13 @@ export class QuickInputController extends Disposable {
quickInputTitleBackground,
quickInputBackground,
quickInputForeground,
contrastBorder,
widgetBorder,
widgetShadow,
} = this.styles.widget;
this.ui.titleBar.style.backgroundColor = quickInputTitleBackground ? quickInputTitleBackground.toString() : '';
this.ui.container.style.backgroundColor = quickInputBackground ? quickInputBackground.toString() : '';
this.ui.container.style.color = quickInputForeground ? quickInputForeground.toString() : '';
this.ui.container.style.border = contrastBorder ? `1px solid ${contrastBorder}` : '';
this.ui.container.style.border = widgetBorder ? `1px solid ${widgetBorder}` : '';
this.ui.container.style.boxShadow = widgetShadow ? `0 0 8px 2px ${widgetShadow}` : '';
this.ui.count.style(this.styles.countBadge);
this.ui.list.style(this.styles.list);
Expand Down
4 changes: 3 additions & 1 deletion src/vs/editor/contrib/find/browser/findWidget.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
padding: 0 4px;
box-sizing: border-box;
transform: translateY(calc(-100% - 10px)); /* shadow (10px) */
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}

.monaco-workbench.reduce-motion .monaco-editor .find-widget {
Expand Down Expand Up @@ -53,7 +55,7 @@

.monaco-editor .find-widget > .find-part,
.monaco-editor .find-widget > .replace-part {
margin: 4px 0 0 17px;
margin: 3px 0 0 17px;
font-size: 12px;
display: flex;
}
Expand Down
7 changes: 6 additions & 1 deletion src/vs/editor/contrib/find/browser/findWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
import { asCssValue, contrastBorder, editorFindMatch, editorFindMatchBorder, editorFindMatchHighlight, editorFindMatchHighlightBorder, editorFindRangeHighlight, editorFindRangeHighlightBorder, editorWidgetBackground, editorWidgetBorder, editorWidgetForeground, editorWidgetResizeBorder, errorForeground, focusBorder, inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground, toolbarHoverBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
import { asCssValue, contrastBorder, editorFindMatch, editorFindMatchBorder, editorFindMatchHighlight, editorFindMatchHighlightBorder, editorFindRangeHighlight, editorFindRangeHighlightBorder, editorWidgetBackground, editorWidgetBorder, editorWidgetForeground, editorWidgetResizeBorder, errorForeground, focusBorder, inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground, toolbarHoverBackground, widgetBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
import { registerIcon, widgetClose } from 'vs/platform/theme/common/iconRegistry';
import { IThemeService, registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService';
import { isHighContrast } from 'vs/platform/theme/common/theme';
Expand Down Expand Up @@ -1389,6 +1389,11 @@ registerThemingParticipant((theme, collector) => {
collector.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${widgetShadowColor}; }`);
}

const widgetBorderColor = theme.getColor(widgetBorder);
if (widgetBorderColor) {
collector.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${widgetBorderColor}; border-right: 1px solid ${widgetBorderColor}; border-bottom: 1px solid ${widgetBorderColor}; }`);
}

const findMatchHighlightBorder = theme.getColor(editorFindMatchHighlightBorder);
if (findMatchHighlightBorder) {
collector.addRule(`.monaco-editor .findMatch { border: 1px ${isHighContrast(theme.type) ? 'dotted' : 'solid'} ${findMatchHighlightBorder}; box-sizing: border-box; }`);
Expand Down
4 changes: 2 additions & 2 deletions src/vs/editor/contrib/rename/browser/renameInputField.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
.monaco-editor .rename-box {
z-index: 100;
color: inherit;
border-radius: 4px;
}

.monaco-editor .rename-box.preview {
padding: 3px 3px 0 3px;
padding: 4px 4px 0 4px;
}

.monaco-editor .rename-box .rename-input {
padding: 3px;
width: calc(100% - 6px);
border-radius: 2px;
}

Expand Down
4 changes: 3 additions & 1 deletion src/vs/editor/contrib/rename/browser/renameInputField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ScrollType } from 'vs/editor/common/editorCommon';
import { localize } from 'vs/nls';
import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { editorWidgetBackground, inputBackground, inputBorder, inputForeground, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
import { editorWidgetBackground, inputBackground, inputBorder, inputForeground, widgetBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
import { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService';

export const CONTEXT_RENAME_INPUT_VISIBLE = new RawContextKey<boolean>('renameInputVisible', false, localize('renameInputVisible', "Whether the rename input widget is visible"));
Expand Down Expand Up @@ -99,8 +99,10 @@ export class RenameInputField implements IContentWidget {
}

const widgetShadowColor = theme.getColor(widgetShadow);
const widgetBorderColor = theme.getColor(widgetBorder);
this._domNode.style.backgroundColor = String(theme.getColor(editorWidgetBackground) ?? '');
this._domNode.style.boxShadow = widgetShadowColor ? ` 0 0 8px 2px ${widgetShadowColor}` : '';
this._domNode.style.border = widgetBorderColor ? `1px solid ${widgetBorderColor}` : '';
this._domNode.style.color = String(theme.getColor(inputForeground) ?? '');

this._input.style.backgroundColor = String(theme.getColor(inputBackground) ?? '');
Expand Down
4 changes: 2 additions & 2 deletions src/vs/platform/quickinput/browser/quickInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { QuickAccessController } from 'vs/platform/quickinput/browser/quickAcces
import { IQuickAccessController } from 'vs/platform/quickinput/common/quickAccess';
import { IInputBox, IInputOptions, IKeyMods, IPickOptions, IQuickInputButton, IQuickInputService, IQuickNavigateConfiguration, IQuickPick, IQuickPickItem, QuickPickInput } from 'vs/platform/quickinput/common/quickInput';
import { defaultButtonStyles, defaultInputBoxStyles, defaultKeybindingLabelStyles, defaultProgressBarStyles, defaultToggleStyles } from 'vs/platform/theme/browser/defaultStyles';
import { activeContrastBorder, badgeBackground, badgeForeground, contrastBorder, pickerGroupBorder, pickerGroupForeground, quickInputBackground, quickInputForeground, quickInputListFocusBackground, quickInputListFocusForeground, quickInputListFocusIconForeground, quickInputTitleBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
import { activeContrastBorder, badgeBackground, badgeForeground, contrastBorder, pickerGroupBorder, pickerGroupForeground, quickInputBackground, quickInputForeground, quickInputListFocusBackground, quickInputListFocusForeground, quickInputListFocusIconForeground, quickInputTitleBackground, widgetBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
import { computeStyles } from 'vs/platform/theme/common/styler';
import { IThemeService, Themable } from 'vs/platform/theme/common/themeService';

Expand Down Expand Up @@ -190,7 +190,7 @@ export class QuickInputService extends Themable implements IQuickInputService {
quickInputBackground,
quickInputForeground,
quickInputTitleBackground,
contrastBorder,
widgetBorder,
widgetShadow
}),
},
Expand Down
1 change: 1 addition & 0 deletions src/vs/platform/theme/common/colorRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ export const textCodeBlockBackground = registerColor('textCodeBlock.background',

// ----- widgets
export const widgetShadow = registerColor('widget.shadow', { dark: transparent(Color.black, .36), light: transparent(Color.black, .16), hcDark: null, hcLight: null }, nls.localize('widgetShadow', 'Shadow color of widgets such as find/replace inside the editor.'));
export const widgetBorder = registerColor('widget.border', { dark: null, light: null, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize('widgetBorder', 'Border color of widgets such as find/replace inside the editor.'));

export const inputBackground = registerColor('input.background', { dark: '#3C3C3C', light: Color.white, hcDark: Color.black, hcLight: Color.white }, nls.localize('inputBoxBackground', "Input box background."));
export const inputForeground = registerColor('input.foreground', { dark: foreground, light: foreground, hcDark: foreground, hcLight: foreground }, nls.localize('inputBoxForeground', "Input box foreground."));
Expand Down
4 changes: 3 additions & 1 deletion src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { FileKind, IFileService, IFileStat } from 'vs/platform/files/common/files';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { WorkbenchDataTree, WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
import { breadcrumbsPickerBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
import { breadcrumbsPickerBackground, widgetBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
import { isWorkspace, isWorkspaceFolder, IWorkspace, IWorkspaceContextService, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { ResourceLabels, IResourceLabel, DEFAULT_LABELS_CONTAINER } from 'vs/workbench/browser/labels';
import { BreadcrumbsConfig } from 'vs/workbench/browser/parts/editor/breadcrumbs';
Expand Down Expand Up @@ -95,7 +95,9 @@ export abstract class BreadcrumbsPicker {
this._treeContainer = document.createElement('div');
this._treeContainer.style.background = color ? color.toString() : '';
this._treeContainer.style.paddingTop = '2px';
this._treeContainer.style.borderRadius = '3px';
this._treeContainer.style.boxShadow = `0 0 8px 2px ${this._themeService.getColorTheme().getColor(widgetShadow)}`;
this._treeContainer.style.border = `1px solid ${this._themeService.getColorTheme().getColor(widgetBorder)}`;
this._domNode.appendChild(this._treeContainer);

this._layoutInfo = { maxHeight, width, arrowSize, arrowOffset, inputHeight: 0 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
bottom: 31px;
display: none;
overflow: hidden;
border-radius: 4px;
}

.monaco-workbench.nostatusbar > .notifications-center {
Expand Down Expand Up @@ -42,3 +43,9 @@
.monaco-workbench > .notifications-center > .notifications-center-header > .notifications-center-header-toolbar .actions-container {
justify-content: flex-end;
}

.monaco-workbench .notifications-center .notifications-list-container,
.monaco-workbench .notifications-center .notifications-list-container .monaco-scrollable-element,
.monaco-workbench .notifications-center .notifications-list-container .notification-list-item {
border-radius: 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
color: var(--vscode-notifications-foreground);
background: var(--vscode-notifications-background);
outline-color: var(--vscode-contrastBorder);
border-radius: inherit;
}

.monaco-workbench .notifications-list-container .notification-list-item {
Expand All @@ -18,6 +19,7 @@
padding: 10px 5px;
height: 100%;
box-sizing: border-box;
border-radius: 4px;
}

.monaco-workbench .notifications-list-container .notification-offset-helper {
Expand All @@ -27,6 +29,10 @@
word-wrap: break-word; /* never overflow long words, but break to next line */
}

.monaco-workbench .notifications-list-container .monaco-scrollable-element {
border-radius: 4px;
}

/** Notification: Main Row */

.monaco-workbench .notifications-list-container .notification-list-item > .notification-list-item-main-row {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
transform: translate3d(0px, 100%, 0px); /* move the notification 50px to the bottom (to prevent bleed through) */
opacity: 0; /* fade the toast in */
transition: transform 300ms ease-out, opacity 300ms ease-out;
border-radius: 4px;
}

.monaco-workbench.reduce-motion > .notifications-toasts .notification-toast-container > .notification-toast {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export class NotificationsCenter extends Themable implements INotificationsCente

const headerBackground = this.getColor(NOTIFICATIONS_CENTER_HEADER_BACKGROUND);
this.notificationsCenterHeader.style.background = headerBackground ? headerBackground.toString() : '';

}
}

Expand Down
10 changes: 5 additions & 5 deletions src/vs/workbench/common/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import { localize } from 'vs/nls';
import { registerColor, editorBackground, contrastBorder, transparent, editorWidgetBackground, textLinkForeground, lighten, darken, focusBorder, activeContrastBorder, editorWidgetForeground, editorErrorForeground, editorWarningForeground, editorInfoForeground, treeIndentGuidesStroke, errorForeground, listActiveSelectionBackground, listActiveSelectionForeground, editorForeground, toolbarHoverBackground, inputBorder } from 'vs/platform/theme/common/colorRegistry';
import { registerColor, editorBackground, contrastBorder, transparent, editorWidgetBackground, textLinkForeground, lighten, darken, focusBorder, activeContrastBorder, editorWidgetForeground, editorErrorForeground, editorWarningForeground, editorInfoForeground, treeIndentGuidesStroke, errorForeground, listActiveSelectionBackground, listActiveSelectionForeground, editorForeground, toolbarHoverBackground, inputBorder, widgetBorder } from 'vs/platform/theme/common/colorRegistry';
import { IColorTheme } from 'vs/platform/theme/common/themeService';
import { Color } from 'vs/base/common/color';
import { ColorScheme } from 'vs/platform/theme/common/theme';
Expand Down Expand Up @@ -799,15 +799,15 @@ export const MENUBAR_SELECTION_BORDER = registerColor('menubar.selectionBorder',
// < --- Notifications --- >

export const NOTIFICATIONS_CENTER_BORDER = registerColor('notificationCenter.border', {
dark: null,
light: null,
dark: widgetBorder,
light: widgetBorder,
hcDark: contrastBorder,
hcLight: contrastBorder
}, localize('notificationCenterBorder', "Notifications center border color. Notifications slide in from the bottom right of the window."));

export const NOTIFICATIONS_TOAST_BORDER = registerColor('notificationToast.border', {
dark: null,
light: null,
dark: widgetBorder,
light: widgetBorder,
hcDark: contrastBorder,
hcLight: contrastBorder
}, localize('notificationToastBorder', "Notification toast border color. Notifications slide in from the bottom right of the window."));
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/debug/browser/debugToolBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { contrastBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
import { widgetBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
import { IThemeService, Themable, ThemeIcon } from 'vs/platform/theme/common/themeService';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { FocusSessionActionViewItem } from 'vs/workbench/contrib/debug/browser/debugActionViewItems';
Expand Down Expand Up @@ -195,7 +195,7 @@ export class DebugToolBar extends Themable implements IWorkbenchContribution {
const widgetShadowColor = this.getColor(widgetShadow);
this.$el.style.boxShadow = widgetShadowColor ? `0 0 8px 2px ${widgetShadowColor}` : '';

const contrastBorderColor = this.getColor(contrastBorder);
const contrastBorderColor = this.getColor(widgetBorder);
const borderColor = this.getColor(debugToolBarBorder);

if (contrastBorderColor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
height: 32px;
display: flex;
padding-left: 7px;
border-radius: 4px;
}

.monaco-workbench .debug-toolbar .monaco-action-bar .action-item {
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/feedback/browser/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ export class FeedbackWidget extends Disposable {
this.feedbackForm.style.backgroundColor = colors.editorWidgetBackground ? colors.editorWidgetBackground.toString() : '';
this.feedbackForm.style.color = colors.editorWidgetForeground ? colors.editorWidgetForeground.toString() : '';
this.feedbackForm.style.boxShadow = colors.widgetShadow ? `0 0 8px 2px ${colors.widgetShadow}` : '';
this.feedbackForm.style.border = colors.widgetBorder ? `1px solid ${colors.widgetBorder}` : '';
}
if (this.feedbackDescriptionInput) {
this.feedbackDescriptionInput.style.backgroundColor = colors.inputBackground ? colors.inputBackground.toString() : '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
right: 6px;
padding: 1em;
cursor: default;
border-radius: 4px;
}

.monaco-workbench .feedback-form h2 {
Expand Down