Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .fantasticonrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ const config = {
fontTypes: ['woff2'],
normalize: true,
// @ts-ignore
assetTypes: ['html', 'scss', 'json'],
assetTypes: ['html', 'scss', 'css', 'json', 'sass'],
templates: {
html: './images/icons/template/icons-contribution.hbs',
scss: './images/icons/template/styles.hbs',
css: './images/icons/template/css-properties.hbs',
sass: './images/icons/template/icon-map.hbs',
},
formatOptions: {
json: {
Expand All @@ -25,8 +27,10 @@ const config = {
pathOptions: {
woff2: './dist/glicons.woff2',
scss: './dist/glicons.scss',
css: './dist/glicons-properties.scss',
html: './dist/icons-contribution.json',
json: './images/icons/template/mapping.json',
sass: './dist/glicons.ts',
},
};

Expand Down
1 change: 0 additions & 1 deletion images/icons/diff-multiple.svg

This file was deleted.

1 change: 0 additions & 1 deletion images/icons/diff-single.svg

This file was deleted.

1 change: 0 additions & 1 deletion images/icons/repo-fetch.svg

This file was deleted.

1 change: 0 additions & 1 deletion images/icons/repo-pull.svg

This file was deleted.

1 change: 0 additions & 1 deletion images/icons/repo-push.svg

This file was deleted.

24 changes: 24 additions & 0 deletions images/icons/template/css-properties.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*

Must be placed at the end of body in the HTML file of any webview that needs it (because of CSP)

<style nonce="#{cspNonce}">
@font-face {
font-family: '{{ name }}';
font-display: block;
src: {{{ fontSrc }}};
}
</style>
*/


/*---------------------
* Custom Properties
*-------------------*/

:root {
--gl-{{ prefix }}-font-family: {{ name }};
{{#each codepoints}}
--gl-{{ ../prefix }}-{{ @key }}-content: '\\{{ codepoint this }}';
{{/each}}
}
20 changes: 20 additions & 0 deletions images/icons/template/icon-map.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*

Must be placed at the end of body in the HTML file of any webview that needs it (because of CSP)

<style nonce="#{cspNonce}">
@font-face {
font-family: '{{ name }}';
font-display: block;
src: {{{ fontSrc }}};
}
</style>
*/

export const gliconsFontFamily = '{{ name }}';

export const gliconsMap = Object.freeze({
{{#each codepoints}}
'gl-{{ @key }}': '\\\{{ codepoint this }}',
{{/each}}
});
7 changes: 1 addition & 6 deletions images/icons/template/mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,5 @@
"repository-filled": 61739,
"gitlens-filled": 61740,
"code-suggestion": 61741,
"diff-multiple": 61742,
"diff-single": 61743,
"repo-fetch": 61744,
"repo-pull": 61745,
"repo-push": 61746,
"provider-jira": 61747
"provider-jira": 61742
}
14 changes: 12 additions & 2 deletions images/icons/template/styles.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Must be placed at the end of body in the HTML file of any webview that needs it
</style>
*/

@use './glicons-properties';

/*---------------------
* Base class
*-------------------*/

.glicon {
font: normal normal normal 16px/1 {{ name }};
display: inline-block;
Expand All @@ -24,6 +30,10 @@ Must be placed at the end of body in the HTML file of any webview that needs it
-ms-user-select: none;
}

.glicon:before {
content: var(--gl-glicon-content);
}

/*---------------------
* Modifiers
*-------------------*/
Expand Down Expand Up @@ -60,7 +70,7 @@ Must be placed at the end of body in the HTML file of any webview that needs it
*-------------------*/

{{#each codepoints}}
.{{ ../prefix }}-{{ @key }}:before {
content: '\\{{ codepoint this }}';
.{{ ../prefix }}-{{ @key }} {
--gl-glicon-content: var(--gl-{{ ../prefix }}-{{ @key }}-content);
}
{{/each}}
61 changes: 13 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6811,21 +6811,21 @@
"command": "gitlens.fetchRepositories",
"title": "Fetch",
"category": "GitLens",
"icon": "$(gitlens-repo-fetch)",
"icon": "$(repo-fetch)",
"enablement": "!operationInProgress"
},
{
"command": "gitlens.pullRepositories",
"title": "Pull",
"category": "GitLens",
"icon": "$(gitlens-repo-pull)",
"icon": "$(repo-pull)",
"enablement": "!operationInProgress"
},
{
"command": "gitlens.pushRepositories",
"title": "Push",
"category": "GitLens",
"icon": "$(gitlens-repo-push)",
"icon": "$(repo-push)",
"enablement": "!operationInProgress"
},
{
Expand Down Expand Up @@ -6895,7 +6895,7 @@
"command": "gitlens.views.fetch",
"title": "Fetch",
"category": "GitLens",
"icon": "$(gitlens-repo-fetch)",
"icon": "$(repo-fetch)",
"enablement": "!operationInProgress"
},
{
Expand All @@ -6916,21 +6916,21 @@
"command": "gitlens.views.pull",
"title": "Pull",
"category": "GitLens",
"icon": "$(gitlens-repo-pull)",
"icon": "$(repo-pull)",
"enablement": "!operationInProgress"
},
{
"command": "gitlens.views.push",
"title": "Push",
"category": "GitLens",
"icon": "$(gitlens-repo-push)",
"icon": "$(repo-push)",
"enablement": "!operationInProgress"
},
{
"command": "gitlens.views.pushWithForce",
"title": "Push (force)",
"category": "GitLens",
"icon": "$(gitlens-repo-force-push)",
"icon": "$(repo-force-push)",
"enablement": "!operationInProgress"
},
{
Expand Down Expand Up @@ -7309,7 +7309,7 @@
"command": "gitlens.views.pushToCommit",
"title": "Push to Commit...",
"category": "GitLens",
"icon": "$(gitlens-repo-push)",
"icon": "$(repo-push)",
"enablement": "!operationInProgress"
},
{
Expand Down Expand Up @@ -8551,21 +8551,21 @@
"command": "gitlens.graph.push",
"title": "Push",
"category": "GitLens",
"icon": "$(gitlens-repo-push)",
"icon": "$(repo-push)",
"enablement": "!operationInProgress"
},
{
"command": "gitlens.graph.pull",
"title": "Pull",
"category": "GitLens",
"icon": "$(gitlens-repo-pull)",
"icon": "$(repo-pull)",
"enablement": "!operationInProgress"
},
{
"command": "gitlens.graph.fetch",
"title": "Fetch",
"category": "GitLens",
"icon": "$(gitlens-repo-fetch)",
"icon": "$(repo-fetch)",
"enablement": "!operationInProgress"
},
{
Expand Down Expand Up @@ -9438,46 +9438,11 @@
"fontCharacter": "\\f12d"
}
},
"gitlens-diff-multiple": {
"description": "diff-multiple icon",
"default": {
"fontPath": "dist/glicons.woff2",
"fontCharacter": "\\f12e"
}
},
"gitlens-diff-single": {
"description": "diff-single icon",
"default": {
"fontPath": "dist/glicons.woff2",
"fontCharacter": "\\f12f"
}
},
"gitlens-repo-fetch": {
"description": "repo-fetch icon",
"default": {
"fontPath": "dist/glicons.woff2",
"fontCharacter": "\\f130"
}
},
"gitlens-repo-pull": {
"description": "repo-pull icon",
"default": {
"fontPath": "dist/glicons.woff2",
"fontCharacter": "\\f131"
}
},
"gitlens-repo-push": {
"description": "repo-push icon",
"default": {
"fontPath": "dist/glicons.woff2",
"fontCharacter": "\\f132"
}
},
"gitlens-provider-jira": {
"description": "provider-jira icon",
"default": {
"fontPath": "dist/glicons.woff2",
"fontCharacter": "\\f133"
"fontCharacter": "\\f12e"
}
}
},
Expand Down Expand Up @@ -17477,7 +17442,7 @@
"@opentelemetry/exporter-trace-otlp-http": "0.50.0",
"@opentelemetry/sdk-trace-base": "1.23.0",
"@shoelace-style/shoelace": "2.15.0",
"@vscode/codicons": "0.0.35",
"@vscode/codicons": "0.0.36",
"@vscode/webview-ui-toolkit": "1.4.0",
"ansi-regex": "6.0.1",
"billboard.js": "3.11.3",
Expand Down
25 changes: 22 additions & 3 deletions scripts/applyIconsContribution.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ const packageJSONPromises = Promise.all([
const scssPromises = Promise.all([
fs.promises.readFile('./dist/glicons.scss', 'utf8'),
fs.promises.readFile('./src/webviews/apps/shared/glicons.scss', 'utf8'),
fs.promises.readFile('./dist/glicons-properties.scss', 'utf8'),
fs.promises.readFile('./src/webviews/apps/shared/glicons-properties.scss', 'utf8'),
fs.promises.readFile('./dist/glicons.ts', 'utf8'),
fs.promises.readFile('./src/webviews/apps/shared/components/glicons.ts', 'utf8'),
]);

let pending = [];
Expand All @@ -16,17 +20,32 @@ let pending = [];
const [{ default: packageJSON }, { default: icons }] = await packageJSONPromises;

if (JSON.stringify(packageJSON.contributes.icons) !== JSON.stringify(icons.icons)) {
packageJSON.contributes.icons = icons;
packageJSON.contributes.icons = {
...icons.icons,
};
const json = `${JSON.stringify(packageJSON, undefined, '\t')}\n`;
pending.push(fs.promises.writeFile('./package.json', json));
}

// Update the scss file
const [newScss, scss] = await scssPromises;
const [newScss, scss, newPropertiesScss, propertiesScss, newMapTs, mapTs] = await scssPromises;

if (scss !== newScss) {
pending.push(fs.promises.writeFile('./src/webviews/apps/shared/glicons.scss', newScss));
}

pending.push(fs.promises.rm('./dist/icons-contribution.json'), fs.promises.rm('./dist/glicons.scss'));
if (propertiesScss !== newPropertiesScss) {
pending.push(fs.promises.writeFile('./src/webviews/apps/shared/glicons-properties.scss', newPropertiesScss));
}

if (mapTs !== newMapTs) {
pending.push(fs.promises.writeFile('./src/webviews/apps/shared/components/glicons.ts', newMapTs));
}

pending.push(
fs.promises.rm('./dist/icons-contribution.json'),
fs.promises.rm('./dist/glicons.scss'),
fs.promises.rm('./dist/glicons-properties.scss'),
fs.promises.rm('./dist/glicons.ts'),
);
await Promise.allSettled(pending);
2 changes: 1 addition & 1 deletion src/commands/quickCommand.buttons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const FeedbackQuickInputButton: QuickInputButton = {
};

export const FetchQuickInputButton: QuickInputButton = {
iconPath: new ThemeIcon('gitlens-repo-fetch'),
iconPath: new ThemeIcon('repo-fetch'),
tooltip: 'Fetch',
};

Expand Down
2 changes: 1 addition & 1 deletion src/webviews/apps/commitDetails/commitDetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@font-face {
font-family: 'glicons';
font-display: block;
src: url('#{root}/dist/glicons.woff2?6ae679c0cde70af8c802b5257e2354a4') format('woff2');
src: url('#{root}/dist/glicons.woff2?887e981267645659b15471f86c55a40e') format('woff2');
}
</style>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class GlStatusNav extends LitElement {
<div class="group">
<gl-tooltip hoist content="Fetch">
<a href="#" class="commit-action" @click=${(e: MouseEvent) => this.handleAction(e, 'fetch')}
><code-icon icon="gl-repo-fetch"></code-icon></a
><code-icon icon="repo-fetch"></code-icon></a
></gl-tooltip>
</div>
`;
Expand Down
4 changes: 2 additions & 2 deletions src/webviews/apps/commitDetails/components/gl-wip-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class GlWipDetails extends GlDetailsBase {
if (ahead === 0 && behind === 0) return undefined;

const fetchLabel = behind > 0 ? 'Pull' : ahead > 0 ? 'Push' : 'Fetch';
const fetchIcon = behind > 0 ? 'gl-repo-pull' : ahead > 0 ? 'gl-repo-push' : 'gl-repo-fetch';
const fetchIcon = behind > 0 ? 'repo-pull' : ahead > 0 ? 'repo-push' : 'repo-fetch';

return html`<p class="button-container">
<span class="button-group button-group--single">
Expand Down Expand Up @@ -257,7 +257,7 @@ export class GlWipDetails extends GlDetailsBase {
<action-nav slot="actions">
<action-item
label="Open Pull Request Changes"
icon="gl-diff-multiple"
icon="diff-multiple"
@click=${() => this.onDataActionClick('open-pr-changes')}
></action-item>
<action-item
Expand Down
2 changes: 1 addition & 1 deletion src/webviews/apps/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@font-face {
font-family: 'glicons';
font-display: block;
src: url('#{root}/dist/glicons.woff2?6ae679c0cde70af8c802b5257e2354a4') format('woff2');
src: url('#{root}/dist/glicons.woff2?887e981267645659b15471f86c55a40e') format('woff2');
}
</style>
</head>
Expand Down
2 changes: 1 addition & 1 deletion src/webviews/apps/plus/focus/focus.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@font-face {
font-family: 'glicons';
font-display: block;
src: url('#{root}/dist/glicons.woff2?6ae679c0cde70af8c802b5257e2354a4') format('woff2');
src: url('#{root}/dist/glicons.woff2?887e981267645659b15471f86c55a40e') format('woff2');
}

:root {
Expand Down
Loading