This reverts commit 714ce79ed9.
This commit is contained in:
Sandeep Somavarapu 2024-04-16 09:49:08 +02:00 committed by GitHub
parent a2194e8c49
commit 31fba19dcf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 40 additions and 68 deletions

View file

@ -17,7 +17,6 @@ function getKnownVariableNames() {
}
return knownVariables;
}
const iconVariable = /^--vscode-icon-.+-(content|font-family)$/;
function getVariableNameValidator() {
const allVariables = getKnownVariableNames();
return (value, report) => {
@ -25,7 +24,7 @@ function getVariableNameValidator() {
let match;
while (match = RE_VAR_PROP.exec(value)) {
const variableName = match[1];
if (variableName && !allVariables.has(variableName) && !iconVariable.test(variableName)) {
if (variableName && !allVariables.has(variableName)) {
report(variableName);
}
}

View file

@ -18,8 +18,6 @@ function getKnownVariableNames() {
return knownVariables;
}
const iconVariable = /^--vscode-icon-.+-(content|font-family)$/;
export interface IValidator {
(value: string, report: (message: string) => void): void;
}
@ -31,7 +29,7 @@ export function getVariableNameValidator(): IValidator {
let match;
while (match = RE_VAR_PROP.exec(value)) {
const variableName = match[1];
if (variableName && !allVariables.has(variableName) && !iconVariable.test(variableName)) {
if (variableName && !allVariables.has(variableName)) {
report(variableName);
}
}

View file

@ -9,7 +9,7 @@
src: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");
}
.codicon {
.codicon[class*='codicon-'] {
font: normal normal normal 16px/1 codicon;
display: inline-block;
text-decoration: none;

View file

@ -99,8 +99,7 @@
.menubar:not(.compact) .menubar-menu-button:first-child .toolbar-toggle-more::before,
.menubar.compact .toolbar-toggle-more::before {
content: var(--vscode-icon-menu-content) !important;
font-family: var(--vscode-icon-menu-font-family) !important;
content: "\eb94" !important;
}
/* Match behavior of outline for activity bar icons */

View file

@ -25,6 +25,5 @@
}
.inline-progress-widget:hover .icon::before {
content: var(--vscode-icon-x-content);
font-family: var(--vscode-icon-x-font-family);
content: "\ea76"; /* codicon-x */
}

View file

@ -31,31 +31,27 @@ export function getIconsStyleSheet(themeService: IThemeService | undefined): IIc
getCSS() {
const productIconTheme = themeService ? themeService.getProductIconTheme() : new UnthemedProductIconTheme();
const usedFontIds: { [id: string]: IconFontDefinition } = {};
const rules: string[] = [];
const rootAttribs: string[] = [];
for (const contribution of iconRegistry.getIcons()) {
const formatIconRule = (contribution: IconContribution): string | undefined => {
const definition = productIconTheme.getIcon(contribution);
if (!definition) {
continue;
return undefined;
}
const fontContribution = definition.font;
const fontFamilyVar = `--vscode-icon-${contribution.id}-font-family`;
const contentVar = `--vscode-icon-${contribution.id}-content`;
if (fontContribution) {
usedFontIds[fontContribution.id] = fontContribution.definition;
rootAttribs.push(
`${fontFamilyVar}: ${asCSSPropertyValue(fontContribution.id)};`,
`${contentVar}: '${definition.fontCharacter}';`,
);
rules.push(`.codicon-${contribution.id}:before { content: '${definition.fontCharacter}'; font-family: ${asCSSPropertyValue(fontContribution.id)}; }`);
} else {
rootAttribs.push(`${contentVar}: '${definition.fontCharacter}'; ${fontFamilyVar}: 'codicon';`);
rules.push(`.codicon-${contribution.id}:before { content: '${definition.fontCharacter}'; }`);
return `.codicon-${contribution.id}:before { content: '${definition.fontCharacter}'; font-family: ${asCSSPropertyValue(fontContribution.id)}; }`;
}
// default font (codicon)
return `.codicon-${contribution.id}:before { content: '${definition.fontCharacter}'; }`;
};
const rules = [];
for (const contribution of iconRegistry.getIcons()) {
const rule = formatIconRule(contribution);
if (rule) {
rules.push(rule);
}
}
for (const id in usedFontIds) {
const definition = usedFontIds[id];
const fontWeight = definition.weight ? `font-weight: ${definition.weight};` : '';
@ -63,9 +59,6 @@ export function getIconsStyleSheet(themeService: IThemeService | undefined): IIc
const src = definition.src.map(l => `${asCSSUrl(l.location)} format('${l.format}')`).join(', ');
rules.push(`@font-face { src: ${src}; font-family: ${asCSSPropertyValue(id)};${fontWeight}${fontStyle} font-display: block; }`);
}
rules.push(`:root { ${rootAttribs.join(' ')} }`);
return rules.join('\n');
}
};

View file

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

View file

@ -196,8 +196,7 @@ body.web {
}
.monaco-workbench .select-container:after {
content: var(--vscode-icon-chevron-down-content);
font-family: var(--vscode-icon-chevron-down-font-family);
content: "\eab4";
font-family: codicon;
font-size: 16px;
width: 16px;

View file

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

View file

@ -420,16 +420,14 @@
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.sticky.dirty > .tab-actions .action-label:not(:hover)::before,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sticky.dirty > .tab-actions .action-label:not(:hover)::before {
/* use `pinned-dirty` icon unicode for sticky-dirty indication */
content: var(--vscode-icon-pinned-dirty-content);
font-family: var(--vscode-icon-pinned-dirty-font-family);
content: "\ebb2"; /* use `pinned-dirty` icon unicode for sticky-dirty indication */
font-family: 'codicon';
}
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.dirty > .tab-actions .action-label:not(:hover)::before,
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty > .tab-actions .action-label:not(:hover)::before {
/* use `circle-filled` icon unicode for dirty indication */
content: var(--vscode-icon-circle-filled-content);
font-family: var(--vscode-icon-circle-filled-font-family);
content: "\ea71"; /* use `circle-filled` icon unicode for dirty indication */
font-family: 'codicon';
}
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active > .tab-actions .action-label,

View file

@ -7,8 +7,8 @@
* Replace with "microphone" icon.
*/
.monaco-workbench .interactive-input-part .monaco-action-bar .action-label.codicon-loading.codicon-modifier-spin:not(.disabled)::before {
content: var(--vscode-icon-mic-filled-content);
font-family: var(--vscode-icon-mic-filled-font-family);
content: "\ec1c";
font-family: 'codicon';
}
/*
@ -22,6 +22,6 @@
* Replace with "stop" icon when reduced motion is enabled.
*/
.monaco-workbench.reduce-motion .interactive-input-part .monaco-action-bar .action-label.codicon-loading.codicon-modifier-spin:not(.disabled)::before {
content: var(--vscode-icon-debug-stop-content);
font-family: var(--vscode-icon-debug-stop-font-family);
content: "\ead7";
font-family: 'codicon';
}

View file

@ -530,8 +530,7 @@ div.preview.inline .monaco-editor .comment-range-glyph {
.monaco-editor .margin-view-overlays > div:hover > .comment-range-glyph.comment-diff-added:before,
.monaco-editor .margin-view-overlays .comment-range-glyph.line-hover:before {
content: var(--vscode-icon-plus-content);
font-family: var(--vscode-icon-plus-font-family);
content: "\ea60";
font-family: "codicon";
border-radius: 3px;
width: 18px !important;
@ -558,13 +557,11 @@ div.preview.inline .monaco-editor .comment-range-glyph {
}
.monaco-editor .comment-range-glyph.comment-thread:before {
content: var(--vscode-icon-comment-add-content);
font-family: var(--vscode-icon-comment-add-font-family);
content: "\ea6b";
}
.monaco-editor .comment-range-glyph.comment-thread-unresolved:before {
content: var(--vscode-icon-comment-unresolved-content);
font-family: var(--vscode-icon-comment-unresolved-font-family);
content: "\ec0a";
}
.monaco-editor.inline-comment .margin-view-overlays .codicon-folding-expanded,

View file

@ -36,8 +36,7 @@
.codicon-debug-breakpoint-conditional.codicon-debug-stackframe::after,
.codicon-debug-breakpoint.codicon-debug-stackframe-focused::after,
.codicon-debug-breakpoint.codicon-debug-stackframe::after {
content: var(--vscode-icon-circle-small-filled-content);
font-family: var(--vscode-icon-circle-small-filled-font-family);
content: '\eb8a';
position: absolute;
}

View file

@ -37,15 +37,13 @@
}
.open-editors .monaco-list .monaco-list-row.dirty:not(:hover) > .monaco-action-bar .codicon-pinned::before {
/* use `pinned-dirty` icon unicode for sticky-dirty indication */
content: var(--vscode-icon-pinned-dirty-content);
font-family: var(--vscode-icon-pinned-dirty-font-family);
content: "\ebb2"; /* use `pinned-dirty` icon unicode for sticky-dirty indication */
font-family: 'codicon';
}
.open-editors .monaco-list .monaco-list-row.dirty:not(:hover) > .monaco-action-bar .codicon-close::before {
/* use `circle-filled` icon unicode for dirty indication */
content: var(--vscode-icon-circle-filled-content);
font-family: var(--vscode-icon-circle-filled-font-family);
content: "\ea71"; /* use `circle-filled` icon unicode for dirty indication */
font-family: 'codicon';
}
.open-editors .monaco-list .monaco-list-row > .monaco-action-bar .action-close-all-files,

View file

@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
.quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-anything::before {
/* Close icon flips between black dot and "X" for dirty open editors */
content: var(--vscode-icon-x-content);
font-family: var(--vscode-icon-x-font-family);
content: "\ea76"; /* Close icon flips between black dot and "X" for dirty open editors */
font-family: 'codicon';
}

View file

@ -4,7 +4,5 @@
*--------------------------------------------------------------------------------------------*/
.monaco-workbench .quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-window::before {
/* Close icon flips between black dot and "X" for dirty open editors */
content: var(--vscode-icon-x-content);
font-family: var(--vscode-icon-x-font-family);
content: "\ea76"; /* Close icon flips between black dot and "X" for dirty windows */
}