用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/johnalbertini14-glitch/openclaw-skills --skill icons命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | Icons |
| description | Implement accessible icons with proper sizing, color inheritance, and performance. |
| metadata | {"clawdbot":{"emoji":"🔣","requires":{},"os":["linux","darwin","win32"]}} |
SVG is the modern standard:
Only consider icon fonts for legacy IE11 support.
Decorative icons (next to visible text):
<button>
<svg aria-hidden="true" focusable="false">...</svg>
Save
</button>
Informative icons (standalone, no label):
<button aria-label="Save document">
<svg aria-hidden="true" focusable="false">...</svg>
</button>
<!-- Or with visually hidden text -->
<button>
<svg aria-hidden="true">...</svg>
<span class="sr-only">Save document</span>
</button>
SVG with accessible name:
<svg role="img" aria-labelledby="icon-title">
<title id="icon-title">Warning: system error</title>
<!-- paths -->
</svg>
Key rules:
aria-hidden="true" on SVGs that duplicate visible textfocusable="false" prevents unwanted tab stops in IE/Edge<title> must be first child inside <svg> for screen reader support<svg fill="currentColor">
<path d="..."/>
</svg>
currentColor inherits from CSS color property. The icon changes color with hover states automatically:
.button { color: blue; }
.button:hover { color: red; } /* icon turns red too */
Remove hardcoded fill="#000" from SVGs before using currentColor.
For stroke-based icons, use stroke="currentColor" instead.
Standard grid sizes: 16, 20, 24, 32px
Match stroke weight to size:
| Size | Stroke | Use case |
|---|---|---|
| 16px | 1px | Dense layouts, small text |
| 20px | 1.25px | Default UI |
| 24px | 1.5px | Buttons, primary actions |
| 32px | 2px | Headers, navigation |
Touch targets need 44x44px minimum—icon can be smaller if tappable area is larger via padding.
.icon-button {
width: 24px;
height: 24px;
padding: 10px; /* Creates 44x44 touch target */
}
.icon {
width: 1em;
height: 1em;
}
Icon scales with surrounding text size automatically.
For many repeated icons, reduce DOM nodes with sprites:
<!-- Define once, hidden -->
<svg style="display:none">
<symbol id="icon-search" viewBox="0 0 24 24">
<path d="..."/>
</symbol>
<symbol id="icon-menu" viewBox="0 0 24 24">
<path d="..."/>
</symbol>
</svg>
<!-- Use anywhere -->
<svg aria-hidden="true"><use href="#icon-search"/></svg>
External sprites (<use href="/icons.svg#search"/>) don't work in older Safari without polyfill.
Benchmark (1000 icons):
<img> with data URI: 67ms (fastest)<img> external: 76msRecommendations:
stopwatch not speedaria-hidden on decorative icons—screen readers announce gibberish