Skip to main content

add-icon

Add new icons to the GitLens GL Icons font

소스 정보

저장소
gitkraken/vscode-gitlens
최근 소스 활동
2026년 7월 4일 01:08
감지된 SKILL.md 언어
영어
스타
9,936
포크
1,801

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
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`: ```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 ```bash 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): ```bash 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.ts` — `gl-` prefix maps to the glicons font): ```typescript html`<code-icon icon="gl-my-new-icon"></code-icon>`; ``` In CSS: ```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"`
GitHub에서 보기