add-icon

GitHub

指导向 GitLens GL Icons 字体添加新图标的完整流程,涵盖 SVG 规范、映射更新、构建命令及缓存验证。

.claude/skills/add-icon/SKILL.md gitkraken/vscode-gitlens

Trigger Scenarios

需要为项目添加新的自定义图标 询问如何贡献或更新 GL Icons 字体

Install

npx skills add gitkraken/vscode-gitlens --skill add-icon -g -y
More Options

Non-standard path

npx skills add https://github.com/gitkraken/vscode-gitlens/tree/main/.claude/skills/add-icon -g -y

Use without installing

npx skills use gitkraken/vscode-gitlens@add-icon

指定 Agent (Claude Code)

npx skills add gitkraken/vscode-gitlens --skill add-icon -a claude-code -g -y

安装 repo 全部 skill

npx skills add gitkraken/vscode-gitlens --all -g -y

预览 repo 内 skill

npx skills add gitkraken/vscode-gitlens --list

SKILL.md

Frontmatter
{
    "name": "add-icon",
    "description": "Add new icons to the GitLens GL Icons font"
}

/add-icon - Add GL Icon

Usage

/add-icon [icon-name]
  • icon-name — kebab-case (e.g., my-new-icon)

Workflow

1. Add SVG File

Place in images/icons/{icon-name}.svg

Requirements:

  • Square viewBox (e.g., viewBox="0 0 16 16")
  • Single color (fill controlled by CSS)
  • No embedded <style> tags or fonts
  • Use fill="currentColor" for color inheritance

2. Update Mapping

Append to images/icons/template/mapping.json:

"icon-name": {next-available-code-point}

Code points are in the Private Use Area range (57344-63743). Check existing entries for next available.

3. Build

pnpm run icons:svgo        # Optimize SVGs
pnpm run build:icons       # Generate font (runs svgo + fantasticon + apply + export)

4. Verify Font Cache-Busting

pnpm run build:icons (via scripts/applyIconsContribution.mjs) now automatically propagates the new glicons.woff2?{hash} cache-bust hash into both src/webviews/apps/shared/glicons.scss and every per-app webview *.html file (each declares its own @font-face). No manual search-replace needed.

Verify they're all unified (every reference must be the same hash):

grep -rho "glicons.woff2?[a-f0-9]*" src/ dist/ | sort | uniq -c

If any HTML file lags behind, re-run pnpm run build:icons — a stale hash leaves that webview pointing at a cached font without the new glyph.

5. Use the Icon

In Lit components (via the shared <code-icon> element, src/webviews/apps/shared/components/code-icon.tsgl- prefix maps to the glicons font):

html`<code-icon icon="gl-my-new-icon"></code-icon>`;

In CSS:

.my-element::before {
	font-family: 'glicons';
	content: '\{codepoint}';
}

Troubleshooting

  • Icon not showing: Check font URL is updated, verify code point in mapping.json, rebuild with pnpm run build:icons
  • SVG issues: Ensure single path/shape, remove <style> tags, use fill="currentColor"

Version History

  • ba869f2 Current 2026-08-20 14:21

Same Skill Collection

.claude/skills/a11y-audit/SKILL.md
.claude/skills/a11y-flow-audit/SKILL.md
.claude/skills/a11y-remediate/SKILL.md
.claude/skills/add-command/SKILL.md
.claude/skills/add-webview/SKILL.md
.claude/skills/challenge-plan/SKILL.md
.claude/skills/commit/SKILL.md
.claude/skills/create-issue/SKILL.md
.claude/skills/deep-planning/SKILL.md
.claude/skills/deep-review/SKILL.md
.claude/skills/dev-scope/SKILL.md
.claude/skills/investigate/SKILL.md
.claude/skills/live-exercise/SKILL.md
.claude/skills/live-inspect/SKILL.md
.claude/skills/live-pair/SKILL.md
.claude/skills/live-perf/SKILL.md
.claude/skills/modern-css/SKILL.md
.claude/skills/prioritize/SKILL.md
.claude/skills/review/SKILL.md
.claude/skills/triage/SKILL.md
.claude/skills/update-issues/SKILL.md
.claude/skills/ux-review/SKILL.md
.claude/skills/worktree/SKILL.md
.claude/skills/add-test/SKILL.md
.claude/skills/audit-commits/SKILL.md

Metadata

Files
0
Version
ba869f2
Hash
c2330778
Indexed
2026-08-20 14:21

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-25 07:54
浙ICP备14020137号-1 $방문자$