搜索

PythonReactSEOPDF
GitHub Skill

add-icon

Add new icons to the GitLens GL Icons font

gitkraken☆ 9,728 仓库 Stars1,674 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

/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. Update Font References

Copy the new glicons.woff2?{hash} URL from src/webviews/apps/shared/glicons.scss and search-replace the old URL across the codebase.

5. Use the Icon

In Lit components:

import { glIcon } from '../shared/components/icons.js';
html`${glIcon('my-new-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"

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-03-11
索引更新时间
2026-03-11
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!