mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
137
src/vs/workbench/browser/style.ts
Normal file
137
src/vs/workbench/browser/style.ts
Normal file
@@ -0,0 +1,137 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./media/style';
|
||||
|
||||
import { registerThemingParticipant, ITheme, ICssStyleCollector, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService';
|
||||
import { foreground, selectionBackground, focusBorder, scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, listHighlightForeground, inputPlaceholderForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { WORKBENCH_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
|
||||
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
|
||||
// Foreground
|
||||
const windowForeground = theme.getColor(foreground);
|
||||
if (windowForeground) {
|
||||
collector.addRule(`.monaco-workbench { color: ${windowForeground}; }`);
|
||||
}
|
||||
|
||||
// Selection
|
||||
const windowSelectionBackground = theme.getColor(selectionBackground);
|
||||
if (windowSelectionBackground) {
|
||||
collector.addRule(`.monaco-workbench ::selection { background-color: ${windowSelectionBackground}; }`);
|
||||
}
|
||||
|
||||
// Input placeholder
|
||||
const placeholderForeground = theme.getColor(inputPlaceholderForeground);
|
||||
if (placeholderForeground) {
|
||||
collector.addRule(`.monaco-workbench input::-webkit-input-placeholder { color: ${placeholderForeground}; }`);
|
||||
collector.addRule(`.monaco-workbench textarea::-webkit-input-placeholder { color: ${placeholderForeground}; }`);
|
||||
}
|
||||
|
||||
// List highlight
|
||||
const listHighlightForegroundColor = theme.getColor(listHighlightForeground);
|
||||
if (listHighlightForegroundColor) {
|
||||
collector.addRule(`
|
||||
.monaco-workbench .monaco-tree .monaco-tree-row .monaco-highlighted-label .highlight,
|
||||
.monaco-workbench .monaco-list .monaco-list-row .monaco-highlighted-label .highlight {
|
||||
color: ${listHighlightForegroundColor};
|
||||
}
|
||||
`);
|
||||
}
|
||||
|
||||
// We need to set the workbench background color so that on Windows we get subpixel-antialiasing.
|
||||
const workbenchBackground = WORKBENCH_BACKGROUND(theme);
|
||||
collector.addRule(`.monaco-workbench { background-color: ${workbenchBackground}; }`);
|
||||
|
||||
// Scrollbars
|
||||
const scrollbarShadowColor = theme.getColor(scrollbarShadow);
|
||||
if (scrollbarShadowColor) {
|
||||
collector.addRule(`
|
||||
.monaco-workbench .monaco-scrollable-element > .shadow.top {
|
||||
box-shadow: ${scrollbarShadowColor} 0 6px 6px -6px inset;
|
||||
}
|
||||
|
||||
.monaco-workbench .monaco-scrollable-element > .shadow.left {
|
||||
box-shadow: ${scrollbarShadowColor} 6px 0 6px -6px inset;
|
||||
}
|
||||
|
||||
.monaco-workbench .monaco-scrollable-element > .shadow.top.left {
|
||||
box-shadow: ${scrollbarShadowColor} 6px 6px 6px -6px inset;
|
||||
}
|
||||
`);
|
||||
}
|
||||
|
||||
const scrollbarSliderBackgroundColor = theme.getColor(scrollbarSliderBackground);
|
||||
if (scrollbarSliderBackgroundColor) {
|
||||
collector.addRule(`
|
||||
.monaco-workbench .monaco-scrollable-element > .scrollbar > .slider {
|
||||
background: ${scrollbarSliderBackgroundColor};
|
||||
}
|
||||
`);
|
||||
}
|
||||
|
||||
const scrollbarSliderHoverBackgroundColor = theme.getColor(scrollbarSliderHoverBackground);
|
||||
if (scrollbarSliderHoverBackgroundColor) {
|
||||
collector.addRule(`
|
||||
.monaco-workbench .monaco-scrollable-element > .scrollbar > .slider:hover {
|
||||
background: ${scrollbarSliderHoverBackgroundColor};
|
||||
}
|
||||
`);
|
||||
}
|
||||
|
||||
const scrollbarSliderActiveBackgroundColor = theme.getColor(scrollbarSliderActiveBackground);
|
||||
if (scrollbarSliderActiveBackgroundColor) {
|
||||
collector.addRule(`
|
||||
.monaco-workbench .monaco-scrollable-element > .scrollbar > .slider.active {
|
||||
background: ${scrollbarSliderActiveBackgroundColor};
|
||||
}
|
||||
`);
|
||||
}
|
||||
|
||||
// Focus outline
|
||||
const focusOutline = theme.getColor(focusBorder);
|
||||
if (focusOutline) {
|
||||
collector.addRule(`
|
||||
.monaco-workbench [tabindex="0"]:focus,
|
||||
.monaco-workbench .synthetic-focus,
|
||||
.monaco-workbench select:focus,
|
||||
.monaco-workbench .monaco-tree.focused.no-focused-item:focus:before,
|
||||
.monaco-workbench .monaco-list:not(.element-focused):focus:before,
|
||||
.monaco-workbench input[type="button"]:focus,
|
||||
.monaco-workbench input[type="text"]:focus,
|
||||
.monaco-workbench button:focus,
|
||||
.monaco-workbench textarea:focus,
|
||||
.monaco-workbench input[type="search"]:focus,
|
||||
.monaco-workbench input[type="checkbox"]:focus {
|
||||
outline-color: ${focusOutline};
|
||||
}
|
||||
`);
|
||||
}
|
||||
|
||||
// High Contrast theme overwrites for outline
|
||||
if (theme.type === HIGH_CONTRAST) {
|
||||
collector.addRule(`
|
||||
.hc-black [tabindex="0"]:focus,
|
||||
.hc-black .synthetic-focus,
|
||||
.hc-black select:focus,
|
||||
.hc-black input[type="button"]:focus,
|
||||
.hc-black input[type="text"]:focus,
|
||||
.hc-black textarea:focus,
|
||||
.hc-black input[type="checkbox"]:focus {
|
||||
outline-style: solid;
|
||||
outline-width: 1px;
|
||||
}
|
||||
|
||||
.hc-black .monaco-tree.focused.no-focused-item:focus:before {
|
||||
outline-width: 1px;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
.hc-black .synthetic-focus input {
|
||||
background: transparent; /* Search input focus fix when in high contrast */
|
||||
}
|
||||
`);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user