Skip to content

Commit 4555840

Browse files
authored
Revert "theme: fix unthemable icons in several areas (microsoft#209131)" (microsoft#210416)
This reverts commit 6b391eb.
1 parent 21e0716 commit 4555840

File tree

16 files changed

+40
-68
lines changed

16 files changed

+40
-68
lines changed

build/lib/stylelint/validateVariableNames.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/stylelint/validateVariableNames.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ function getKnownVariableNames() {
1818
return knownVariables;
1919
}
2020

21-
const iconVariable = /^--vscode-icon-.+-(content|font-family)$/;
22-
2321
export interface IValidator {
2422
(value: string, report: (message: string) => void): void;
2523
}
@@ -31,7 +29,7 @@ export function getVariableNameValidator(): IValidator {
3129
let match;
3230
while (match = RE_VAR_PROP.exec(value)) {
3331
const variableName = match[1];
34-
if (variableName && !allVariables.has(variableName) && !iconVariable.test(variableName)) {
32+
if (variableName && !allVariables.has(variableName)) {
3533
report(variableName);
3634
}
3735
}

src/vs/base/browser/ui/codicons/codicon/codicon.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
src: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");
1010
}
1111

12-
.codicon {
12+
.codicon[class*='codicon-'] {
1313
font: normal normal normal 16px/1 codicon;
1414
display: inline-block;
1515
text-decoration: none;

src/vs/base/browser/ui/menu/menubar.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@
9999

100100
.menubar:not(.compact) .menubar-menu-button:first-child .toolbar-toggle-more::before,
101101
.menubar.compact .toolbar-toggle-more::before {
102-
content: var(--vscode-icon-menu-content) !important;
103-
font-family: var(--vscode-icon-menu-font-family) !important;
102+
content: "\eb94" !important;
104103
}
105104

106105
/* Match behavior of outline for activity bar icons */

src/vs/editor/contrib/inlineProgress/browser/inlineProgressWidget.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@
2525
}
2626

2727
.inline-progress-widget:hover .icon::before {
28-
content: var(--vscode-icon-x-content);
29-
font-family: var(--vscode-icon-x-font-family);
28+
content: "\ea76"; /* codicon-x */
3029
}

src/vs/platform/theme/browser/iconsStyleSheet.ts

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,41 +31,34 @@ export function getIconsStyleSheet(themeService: IThemeService | undefined): IIc
3131
getCSS() {
3232
const productIconTheme = themeService ? themeService.getProductIconTheme() : new UnthemedProductIconTheme();
3333
const usedFontIds: { [id: string]: IconFontDefinition } = {};
34-
35-
const rules: string[] = [];
36-
const rootAttribs: string[] = [];
37-
for (const contribution of iconRegistry.getIcons()) {
34+
const formatIconRule = (contribution: IconContribution): string | undefined => {
3835
const definition = productIconTheme.getIcon(contribution);
3936
if (!definition) {
40-
continue;
37+
return undefined;
4138
}
42-
4339
const fontContribution = definition.font;
44-
const fontFamilyVar = `--vscode-icon-${contribution.id}-font-family`;
45-
const contentVar = `--vscode-icon-${contribution.id}-content`;
4640
if (fontContribution) {
4741
usedFontIds[fontContribution.id] = fontContribution.definition;
48-
rootAttribs.push(
49-
`${fontFamilyVar}: ${asCSSPropertyValue(fontContribution.id)};`,
50-
`${contentVar}: '${definition.fontCharacter}';`,
51-
);
52-
rules.push(`.codicon-${contribution.id}:before { content: '${definition.fontCharacter}'; font-family: ${asCSSPropertyValue(fontContribution.id)}; }`);
53-
} else {
54-
rootAttribs.push(`${contentVar}: '${definition.fontCharacter}'; ${fontFamilyVar}: 'codicon';`);
55-
rules.push(`.codicon-${contribution.id}:before { content: '${definition.fontCharacter}'; }`);
42+
return `.codicon-${contribution.id}:before { content: '${definition.fontCharacter}'; font-family: ${asCSSPropertyValue(fontContribution.id)}; }`;
5643
}
57-
}
44+
// default font (codicon)
45+
return `.codicon-${contribution.id}:before { content: '${definition.fontCharacter}'; }`;
46+
};
5847

48+
const rules = [];
49+
for (const contribution of iconRegistry.getIcons()) {
50+
const rule = formatIconRule(contribution);
51+
if (rule) {
52+
rules.push(rule);
53+
}
54+
}
5955
for (const id in usedFontIds) {
6056
const definition = usedFontIds[id];
6157
const fontWeight = definition.weight ? `font-weight: ${definition.weight};` : '';
6258
const fontStyle = definition.style ? `font-style: ${definition.style};` : '';
6359
const src = definition.src.map(l => `${asCSSUrl(l.location)} format('${l.format}')`).join(', ');
6460
rules.push(`@font-face { src: ${src}; font-family: ${asCSSPropertyValue(id)};${fontWeight}${fontStyle} font-display: block; }`);
6561
}
66-
67-
rules.push(`:root { ${rootAttribs.join(' ')} }`);
68-
6962
return rules.join('\n');
7063
}
7164
};

src/vs/workbench/browser/actions/media/actions.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
.monaco-workbench .quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-workspace::before {
7-
/* Close icon flips between black dot and "X" for dirty workspaces */
8-
content: var(--vscode-icon-x-content);
9-
font-family: var(--vscode-icon-x-font-family);
7+
content: "\ea76"; /* Close icon flips between black dot and "X" for dirty workspaces */
108
}
119

1210
.monaco-workbench .screencast-mouse {

src/vs/workbench/browser/media/style.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ body.web {
196196
}
197197

198198
.monaco-workbench .select-container:after {
199-
content: var(--vscode-icon-chevron-down-content);
200-
font-family: var(--vscode-icon-chevron-down-font-family);
199+
content: "\eab4";
201200
font-family: codicon;
202201
font-size: 16px;
203202
width: 16px;

src/vs/workbench/browser/parts/editor/media/editorquickaccess.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
.quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-editor::before {
7-
/* Close icon flips between black dot and "X" for dirty open editors */
8-
content: var(--vscode-icon-x-content);
9-
font-family: var(--vscode-icon-x-font-family);
7+
content: "\ea76"; /* Close icon flips between black dot and "X" for dirty open editors */
108
}

src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -420,16 +420,14 @@
420420

421421
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.sticky.dirty > .tab-actions .action-label:not(:hover)::before,
422422
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sticky.dirty > .tab-actions .action-label:not(:hover)::before {
423-
/* use `pinned-dirty` icon unicode for sticky-dirty indication */
424-
content: var(--vscode-icon-pinned-dirty-content);
425-
font-family: var(--vscode-icon-pinned-dirty-font-family);
423+
content: "\ebb2"; /* use `pinned-dirty` icon unicode for sticky-dirty indication */
424+
font-family: 'codicon';
426425
}
427426

428427
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.dirty > .tab-actions .action-label:not(:hover)::before,
429428
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty > .tab-actions .action-label:not(:hover)::before {
430-
/* use `circle-filled` icon unicode for dirty indication */
431-
content: var(--vscode-icon-circle-filled-content);
432-
font-family: var(--vscode-icon-circle-filled-font-family);
429+
content: "\ea71"; /* use `circle-filled` icon unicode for dirty indication */
430+
font-family: 'codicon';
433431
}
434432

435433
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active > .tab-actions .action-label,

0 commit comments

Comments
 (0)