css debt - remove more expensive rules or make them conditional

This commit is contained in:
Benjamin Pasero 2018-03-06 12:18:05 +01:00
parent 5fb74d7f63
commit d7bd90445a
16 changed files with 50 additions and 90 deletions

View File

@ -8,7 +8,7 @@
user-select: none;
}
.monaco-editor .colorpicker-hover[tabindex="0"]:focus {
.monaco-editor .colorpicker-hover:focus {
outline: none;
}

View File

@ -12,7 +12,7 @@
flex-shrink: 0;
align-items: center;
justify-content: center;
-webkit-user-select: none;
user-select: none;
-webkit-app-region: drag;
zoom: 1; /* prevent zooming */
line-height: 22px;

View File

@ -10,7 +10,7 @@
padding: 0;
overflow: hidden;
font-size: 11px;
-webkit-user-select: none;
user-select: none;
}
/* Font Families (with CJK support) */
@ -21,7 +21,6 @@
.monaco-shell:lang(ja) { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Noto Sans", "Meiryo", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif; }
.monaco-shell:lang(ko) { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Noto Sans", "Malgun Gothic", "Nanum Gothic", "Dotom", "Apple SD Gothic Neo", "AppleGothic", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
@-webkit-keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.monaco-shell img {
@ -66,29 +65,12 @@
cursor: pointer;
}
.monaco-shell input[type="search"]::-webkit-search-decoration,
.monaco-shell input[type="search"]::-webkit-search-results-button,
.monaco-shell input[type="search"]::-webkit-search-results-decoration {
display: none;
}
.monaco-shell input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: none;
height: 18px;
width: 18px;
background-image: url('clear.svg');
background-repeat: no-repeat;
background-position: center center;
}
/* START Keyboard Focus Indication Styles */
.monaco-shell [tabindex="0"]:focus,
.monaco-shell .synthetic-focus,
.monaco-shell select:focus,
.monaco-shell input[type="button"]:focus,
.monaco-shell input[type="submit"]:focus,
.monaco-shell input[type="search"]:focus,
.monaco-shell input[type="text"]:focus,
.monaco-shell textarea:focus,
.monaco-shell input[type="checkbox"]:focus {
@ -98,28 +80,23 @@
opacity: 1 !important;
}
.monaco-shell [tabindex="0"]:active,
.monaco-shell select:active,
.monaco-shell input[type="button"]:active,
.monaco-shell input[type="checkbox"]:active,
.monaco-shell .monaco-tree .monaco-tree-row
.monaco-action-bar .action-item [tabindex="0"]:hover,
.monaco-shell .monaco-tree.focused.no-focused-item:active:before {
outline: 0 !important; /* fixes some flashing outlines from showing up when clicking */
}
.monaco-shell .mac select:focus {
border: none; /* outline is a square, but border has a radius, so we avoid this glitch when focused (https://github.com/Microsoft/vscode/issues/26045) */
}
.monaco-shell.hc-black [tabindex="0"]:focus,
.monaco-shell.hc-black .synthetic-focus,
.monaco-shell.hc-black select:focus,
.monaco-shell.hc-black input[type="button"]:focus,
.monaco-shell.hc-black input[type="text"]:focus,
.monaco-shell.hc-black textarea:focus,
.monaco-shell.hc-black input[type="search"]:focus,
.monaco-shell.hc-black input[type="checkbox"]:focus {
outline-style: solid;
outline-width: 1px;
}
.monaco-shell.hc-black .synthetic-focus input {
background: transparent; /* Search input focus fix when in high contrast */
}
.monaco-shell.vs .monaco-tree.focused .monaco-tree-row.focused [tabindex="0"]:focus,
.monaco-shell.vs-dark .monaco-tree.focused .monaco-tree-row.focused [tabindex="0"]:focus {
.monaco-shell .monaco-tree.focused .monaco-tree-row.focused [tabindex="0"]:focus {
outline-width: 1px; /* higher contrast color for focusable elements in a row that shows focus feedback */
outline-style: solid;
}
@ -140,11 +117,6 @@
outline-offset: -1px;
}
.monaco-shell.hc-black .monaco-tree.focused.no-focused-item:focus:before {
outline-width: 1px;
outline-offset: -2px;
}
.monaco-shell .synthetic-focus :focus {
outline: 0 !important; /* elements within widgets that draw synthetic-focus should never show focus */
}
@ -161,15 +133,4 @@
.monaco-shell .monaco-tree.focused:focus,
.monaco-shell .monaco-list:focus {
outline: 0 !important; /* tree indicates focus not via outline but through the focused item */
}
.monaco-shell [tabindex="0"]:active,
.monaco-shell select:active,
.monaco-shell input[type="button"]:active,
.monaco-shell input[type="submit"]:active,
.monaco-shell input[type="checkbox"]:active,
.monaco-shell .monaco-tree .monaco-tree-row
.monaco-action-bar .action-item [tabindex="0"]:hover,
.monaco-shell .monaco-tree.focused.no-focused-item:active:before {
outline: 0 !important; /* fixes some flashing outlines from showing up when clicking */
}

View File

@ -76,7 +76,7 @@ import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/work
import { WorkbenchThemeService } from 'vs/workbench/services/themes/electron-browser/workbenchThemeService';
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
import { TextResourceConfigurationService } from 'vs/editor/common/services/resourceConfigurationImpl';
import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
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 { TextMateService } from 'vs/workbench/services/textMate/electron-browser/TMSyntax';
import { ITextMateService } from 'vs/workbench/services/textMate/electron-browser/textMateService';
@ -646,4 +646,29 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
}
`);
}
// High Contrast theme overwrites for outline
if (theme.type === HIGH_CONTRAST) {
collector.addRule(`
.monaco-shell.hc-black [tabindex="0"]:focus,
.monaco-shell.hc-black .synthetic-focus,
.monaco-shell.hc-black select:focus,
.monaco-shell.hc-black input[type="button"]:focus,
.monaco-shell.hc-black input[type="text"]:focus,
.monaco-shell.hc-black textarea:focus,
.monaco-shell.hc-black input[type="checkbox"]:focus {
outline-style: solid;
outline-width: 1px;
}
.monaco-shell.hc-black .monaco-tree.focused.no-focused-item:focus:before {
outline-width: 1px;
outline-offset: -2px;
}
.monaco-shell.hc-black .synthetic-focus input {
background: transparent; /* Search input focus fix when in high contrast */
}
`);
}
});

View File

@ -5,11 +5,6 @@
.tm-inspect-widget {
z-index: 50;
-webkit-user-select: text;
-ms-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-o-user-select: text;
user-select: text;
padding: 10px;
}

View File

@ -10,7 +10,7 @@
z-index: 50;
animation-duration: 0.15s;
animation-name: fadeIn;
-webkit-user-select: text;
user-select: text;
word-break: break-all;
padding: 4px 5px;
}
@ -35,7 +35,7 @@
}
.monaco-editor .debug-hover-widget .debug-hover-tree .monaco-tree .monaco-tree-row > .content {
-webkit-user-select: text;
user-select: text;
white-space: pre;
}

View File

@ -10,11 +10,6 @@
.monaco-editor .zone-widget .zone-widget-container.exception-widget {
padding: 6px 10px;
white-space: pre-wrap;
-webkit-user-select: text;
-ms-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-o-user-select: text;
user-select: text;
}

View File

@ -23,7 +23,7 @@
.monaco-workbench .repl .repl-tree .monaco-tree .monaco-tree-row > .content {
line-height: 18px;
-webkit-user-select: text;
user-select: text;
/* Wrap words but also do not trim whitespace #6275 */
word-wrap: break-word;
white-space: pre-wrap;

View File

@ -57,7 +57,6 @@
padding: 0px 4px;
border-radius: 4px;
user-select: text;
-webkit-user-select: text;
white-space: nowrap;
}

View File

@ -70,7 +70,6 @@
.hc-black .monaco-action-bar .extension-host-profile-stop {
background: url('profile-stop-inverse.svg') center center no-repeat;
animation:fade 1000ms infinite;
-webkit-animation:fade 1000ms infinite;
}
.monaco-action-bar .save-extension-host-profile {
@ -101,17 +100,10 @@
height: 16px;
vertical-align: middle;
animation:fade 1000ms infinite;
-webkit-animation:fade 1000ms infinite;
}
@keyframes fade {
from { opacity: 1.0; }
50% { opacity: 0.5; }
to { opacity: 1.0; }
}
@-webkit-keyframes fade {
from { opacity: 1.0; }
50% { opacity: 0.5; }
to { opacity: 1.0; }
}

View File

@ -246,7 +246,7 @@ export class FeedbackDropdown extends Dropdown {
$('label').attr('for', 'hide-button').text(nls.localize('showFeedback', "Show Feedback Smiley in Status Bar")).appendTo($hideButtonContainer);
this.sendButton = this.invoke($('input.send').type('submit').attr('disabled', '').value(nls.localize('tweet', "Tweet")).appendTo($buttons), () => {
this.sendButton = this.invoke($('input.send').type('button').attr('disabled', '').value(nls.localize('tweet', "Tweet")).appendTo($buttons), () => {
if (this.isSendingFeedback) {
return;
}

View File

@ -48,10 +48,14 @@
text-overflow: ellipsis;
}
.settings-tabs-widget > .monaco-action-bar .action-item .action-label:not([aria-haspopup]) {
.settings-tabs-widget > .monaco-action-bar .action-item .action-label {
display: block;
}
.settings-tabs-widget > .monaco-action-bar .action-item .action-label.folder-settings {
display: flex;
}
.settings-tabs-widget > .monaco-action-bar .actions-container {
justify-content: flex-start;
}
@ -213,7 +217,6 @@
width: 100%;
cursor: pointer;
font-weight: bold;
-webkit-user-select: none;
user-select: none;
display: flex;
}

View File

@ -324,7 +324,7 @@ export class FolderSettingsActionItem extends BaseActionItem {
this.labelElement = DOM.$('.action-title');
this.detailsElement = DOM.$('.action-details');
this.dropDownElement = DOM.$('.dropdown-icon.octicon.octicon-triangle-down.hide');
this.anchorElement = DOM.$('a.action-label', {
this.anchorElement = DOM.$('a.action-label.folder-settings', {
role: 'button',
'aria-haspopup': 'true',
'tabindex': '0'

View File

@ -18,13 +18,7 @@
left: 0;
width: 16px;
height: 100%;
-webkit-box-sizing: border-box;
-o-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
background-position: center center;
background-repeat: no-repeat;
cursor: pointer;
@ -166,7 +160,6 @@
margin-top: 0px;
margin-bottom: 0px;
padding-bottom: 4px;
-webkit-user-select: text;
user-select: text;
}

View File

@ -44,8 +44,6 @@
font-feature-settings: "liga" 0;
position: relative;
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
}
.xterm.focus,

View File

@ -8,7 +8,6 @@
padding: 10px 20px;
line-height: 22px;
user-select: initial;
-webkit-user-select: initial;
}
.monaco-workbench > .part.editor > .content .walkThroughContent img {