Skip to content

Commit

Permalink
Remove redundant CSS rules (#165401)
Browse files Browse the repository at this point in the history
Ref #165169
Ref #157564

After changing workspace trust and policy settings
to use indicators, a bunch of CSS rules became redundant.
This PR removes those CSS rules.
  • Loading branch information
rzhao271 authored Nov 3, 2022
1 parent 708cd91 commit 78f27b8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -417,22 +417,6 @@
-webkit-user-select: text;
}

.settings-editor > .settings-body .settings-tree-container .setting-item.setting-item-untrusted > .setting-item-contents .setting-item-trust-description,
.settings-editor > .settings-body .settings-tree-container .setting-item > .setting-item-contents .setting-item-policy-description {
display: flex;
font-weight: 600;
margin: 6px 0 12px 0;
}

.settings-editor > .settings-body .settings-tree-container .setting-item > .setting-item-contents .setting-item-policy-description[hidden] {
display: none;
}

.settings-editor > .settings-body .settings-tree-container .setting-item.setting-item-untrusted > .setting-item-contents .setting-item-trust-description > span,
.settings-editor > .settings-body .settings-tree-container .setting-item > .setting-item-contents .setting-item-policy-description > span {
padding-right: 5px;
}

.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-validation-message {
display: none;
}
Expand Down Expand Up @@ -472,14 +456,12 @@
margin: 0px;
}

.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-trust-description a:focus,
.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-markdown a:focus {
outline: 1px solid -webkit-focus-ring-color;
outline-offset: -1px;
text-decoration: underline;
}

.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-trust-description a:hover,
.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-markdown a:hover {
cursor: pointer;
text-decoration: underline;
Expand Down
4 changes: 0 additions & 4 deletions src/vs/workbench/contrib/preferences/browser/settingsTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2285,9 +2285,6 @@ export class SettingsTree extends WorkbenchObjectTree<SettingsTreeElement> {
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-description { color: ${fgWithOpacity}; }`);
collector.addRule(`.settings-editor > .settings-body .settings-toc-container .monaco-list-row:not(.selected) { color: ${fgWithOpacity}; }`);

const disabledfgColor = new Color(new RGBA(foregroundColor.rgba.r, foregroundColor.rgba.g, foregroundColor.rgba.b, 0.7));
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item.setting-item-untrusted > .setting-item-contents .setting-item-description { color: ${disabledfgColor}; }`);

// Hack for subpixel antialiasing
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-title .setting-item-overrides,
.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-title .setting-item-ignored { color: ${fgWithOpacity}; }`);
Expand Down Expand Up @@ -2338,7 +2335,6 @@ export class SettingsTree extends WorkbenchObjectTree<SettingsTreeElement> {

const focusBorderColor = theme.getColor(focusBorder);
if (focusBorderColor) {
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-trust-description a:focus { outline-color: ${focusBorderColor} }`);
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-markdown a:focus { outline-color: ${focusBorderColor} }`);
}
}));
Expand Down
10 changes: 0 additions & 10 deletions src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { SelectBox } from 'vs/base/browser/ui/selectBox/selectBox';
import { IAction } from 'vs/base/common/actions';
import { disposableTimeout } from 'vs/base/common/async';
import { Codicon } from 'vs/base/common/codicons';
import { Color, RGBA } from 'vs/base/common/color';
import { Emitter, Event } from 'vs/base/common/event';
import { KeyCode } from 'vs/base/common/keyCodes';
import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
Expand Down Expand Up @@ -49,21 +48,14 @@ registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) =

const link = theme.getColor(textLinkForeground);
if (link) {
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-trust-description a { color: ${link}; }`);
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-trust-description a > code { color: ${link}; }`);
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-markdown a { color: ${link}; }`);
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-markdown a > code { color: ${link}; }`);
collector.addRule(`.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a { color: ${link}; }`);
collector.addRule(`.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a > code { color: ${link}; }`);

const disabledfgColor = new Color(new RGBA(link.rgba.r, link.rgba.g, link.rgba.b, 0.8));
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item.setting-item-untrusted > .setting-item-contents .setting-item-markdown a { color: ${disabledfgColor}; }`);
}

const activeLink = theme.getColor(textLinkActiveForeground);
if (activeLink) {
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-trust-description a:hover, .settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-trust-description a:active { color: ${activeLink}; }`);
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-trust-description a:hover > code, .settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-trust-description a:active > code { color: ${activeLink}; }`);
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-markdown a:hover, .settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-markdown a:active { color: ${activeLink}; }`);
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-markdown a:hover > code, .settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-markdown a:active > code { color: ${activeLink}; }`);
collector.addRule(`.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a:hover, .monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a:active { color: ${activeLink}; }`);
Expand Down Expand Up @@ -120,8 +112,6 @@ registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) =
if (codeTextForegroundColor) {
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item .setting-item-markdown code { color: ${codeTextForegroundColor} }`);
collector.addRule(`.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown code { color: ${codeTextForegroundColor} }`);
const disabledfgColor = new Color(new RGBA(codeTextForegroundColor.rgba.r, codeTextForegroundColor.rgba.g, codeTextForegroundColor.rgba.b, 0.8));
collector.addRule(`.settings-editor > .settings-body .settings-tree-container .setting-item.setting-item-untrusted > .setting-item-contents .setting-item-description .setting-item-markdown code { color: ${disabledfgColor} }`);
}

const modifiedItemIndicatorColor = theme.getColor(modifiedItemIndicator);
Expand Down

0 comments on commit 78f27b8

Please sign in to comment.