← 返回 Skills 市场
ivangdavila

Icons

作者 Iván · GitHub ↗ · v1.0.0
linuxdarwinwin32 ✓ 安全检测通过
1076
总下载
2
收藏
6
当前安装
1
版本数
在 OpenClaw 中安装
/install icons
功能描述
Implement accessible icons with proper sizing, color inheritance, and performance.
使用说明 (SKILL.md)

SVG vs Icon Fonts

SVG is the modern standard:

  • Better accessibility (native ARIA support)
  • No flash of invisible/wrong icon (FOIT)
  • Multicolor support
  • Smaller bundles with tree-shaking

Only consider icon fonts for legacy IE11 support.

Accessibility Patterns

Decorative icons (next to visible text):

\x3Cbutton>
  \x3Csvg aria-hidden="true" focusable="false">...\x3C/svg>
  Save
\x3C/button>

Informative icons (standalone, no label):

\x3Cbutton aria-label="Save document">
  \x3Csvg aria-hidden="true" focusable="false">...\x3C/svg>
\x3C/button>

\x3C!-- Or with visually hidden text -->
\x3Cbutton>
  \x3Csvg aria-hidden="true">...\x3C/svg>
  \x3Cspan class="sr-only">Save document\x3C/span>
\x3C/button>

SVG with accessible name:

\x3Csvg role="img" aria-labelledby="icon-title">
  \x3Ctitle id="icon-title">Warning: system error\x3C/title>
  \x3C!-- paths -->
\x3C/svg>

Key rules:

  • aria-hidden="true" on SVGs that duplicate visible text
  • focusable="false" prevents unwanted tab stops in IE/Edge
  • \x3Ctitle> must be first child inside \x3Csvg> for screen reader support
  • IDs must be unique if multiple SVGs are inline

Color Inheritance

\x3Csvg fill="currentColor">
  \x3Cpath d="..."/>
\x3C/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.

Sizing

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 */
}

Scaling with Text

.icon {
  width: 1em;
  height: 1em;
}

Icon scales with surrounding text size automatically.

Symbol Sprites

For many repeated icons, reduce DOM nodes with sprites:

\x3C!-- Define once, hidden -->
\x3Csvg style="display:none">
  \x3Csymbol id="icon-search" viewBox="0 0 24 24">
    \x3Cpath d="..."/>
  \x3C/symbol>
  \x3Csymbol id="icon-menu" viewBox="0 0 24 24">
    \x3Cpath d="..."/>
  \x3C/symbol>
\x3C/svg>

\x3C!-- Use anywhere -->
\x3Csvg aria-hidden="true">\x3Cuse href="#icon-search"/>\x3C/svg>

External sprites (\x3Cuse href="/icons.svg#search"/>) don't work in older Safari without polyfill.

Performance

Benchmark (1000 icons):

  • \x3Cimg> with data URI: 67ms (fastest)
  • Inline SVG optimized: 75ms
  • Symbol sprite: 99ms
  • \x3Cimg> external: 76ms

Recommendations:

  • Tree-shake icon libraries (Lucide, Heroicons support this)
  • Don't import entire Font Awesome (1MB+)—use subset or switch to SVG
  • Inline critical icons, lazy-load sprite for non-critical

Consistency

  • Stick to one icon set—mixing styles looks unprofessional
  • Match icon stroke weight to your font weight (regular text = 1.5px stroke)
  • Pick one style per context: outlined for inactive, filled for active
  • Optical alignment differs from mathematical—circles reach edges, squares don't
  • Name icons by appearance, not meaning: stopwatch not speed

Common Mistakes

  • Missing aria-hidden on decorative icons—screen readers announce gibberish
  • Mixing rounded and sharp icon styles in same interface
  • Giant icon libraries for 10 icons—massive bundle bloat
  • Icon-only buttons without accessible name—impossible to use with screen readers
  • Hardcoded colors preventing theme switching
  • Stroke width not scaling with icon size—16px icon with 2px stroke looks heavy
安全使用建议
This skill is a text-only guide for icon implementation and poses minimal technical risk because it doesn't install code or request credentials. However, the source and homepage are unknown — if provenance matters to you, prefer skills from known maintainers or include a link to the original guidance you trust. If you permit autonomous invocation of skills, note that this one can be called by the agent but has no elevated privileges or access to secrets.
功能分析
Type: OpenClaw Skill Name: icons Version: 1.0.0 The skill bundle contains a `_meta.json` file with standard metadata and a `SKILL.md` file providing comprehensive documentation on best practices for implementing accessible icons. The `SKILL.md` content is purely instructional, offering HTML, CSS, and SVG code examples for developers. There are no executable commands, no attempts at prompt injection against the AI agent, no requests for sensitive data, and no indications of malicious or suspicious activities like data exfiltration, unauthorized execution, or persistence mechanisms. The content is entirely aligned with its stated purpose.
能力评估
Purpose & Capability
Name and description match the SKILL.md content: guidance on SVG vs icon fonts, accessibility, sizing, color inheritance, sprites, and performance. Nothing requested or required is disproportionate to delivering guidance.
Instruction Scope
SKILL.md contains examples and best-practice prose only (HTML/CSS snippets). It does not instruct the agent to read files, access environment variables, call external endpoints, run commands, or transmit data.
Install Mechanism
No install spec or code files are provided. Being instruction-only means nothing is written to disk or downloaded during install.
Credentials
No environment variables, credentials, or config paths are declared or used; the requested access is proportional (none) for a documentation-style skill.
Persistence & Privilege
always is false and model invocation is allowed (default). The skill does not request permanent presence or modify other skills or system-wide settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install icons
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /icons 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release
元数据
Slug icons
版本 1.0.0
许可证
累计安装 6
当前安装数 6
历史版本数 1
常见问题

Icons 是什么?

Implement accessible icons with proper sizing, color inheritance, and performance. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1076 次。

如何安装 Icons?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install icons」即可一键安装,无需额外配置。

Icons 是免费的吗?

是的,Icons 完全免费(开源免费),可自由下载、安装和使用。

Icons 支持哪些平台?

Icons 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(linux, darwin, win32)。

谁开发了 Icons?

由 Iván(@ivangdavila)开发并维护,当前版本 v1.0.0。

💬 留言讨论