Skip to content

opentiny/tiny-vue / .agents/skills

tinyvue-develop-spec

Verified

tinyvue组件库开发规范

FileKindSize
SKILL.mdskill md3.4 KB
common.skill.mdmarkdown7.8 KB
design.skill.mdmarkdown9.9 KB
directive.skill.mdmarkdown6.0 KB
hooks.skill.mdmarkdown5.9 KB
i18n-workflow.skill.mdmarkdown9.9 KB
icon.skill.mdmarkdown1.3 KB
renderless.skill.mdmarkdown9.4 KB
testing-guide.skill.mdmarkdown11.2 KB
theme.skill.mdmarkdown11.5 KB
utils.skill.mdmarkdown5.7 KB
vue.skill.mdmarkdown9.1 KB

icon.skill.md

View on GitHub
# ICON 开发规范

## 核心原理

所有的图标原始文件在 `packages/theme/src/svgs` 目录中,每个svg文件对应一个图标,图标名字为小写连字符的格式。

图标库的位置在 `packages\vue-icon`, 它依赖 `@opentiny/vue-theme`包,通过`vite-svg-loader`插件,引用svg文件转为标准的Vue组件。

图标库中的每一个图标都是一个函数,函数中调用适配层的 `svg`函数包装组件一下,返回一个标准的Vue组件。

```typescript
import { svg } from '@opentiny/vue-common'
import Acceptance from '@opentiny/vue-theme/svgs/acceptance.svg'

export default () => svg({ name: 'IconAcceptance', component: Acceptance, filledComponent: Acceptance })()
```

`svg` 函数的路径为: `packages\vue-common\src\index.ts`

## 图标库的开发步骤

1. 设计师提供原始的svg图标

将图标放到 `packages/theme/src/svgs` 目录中,修改文件名为小写连字符的格式,该文件名即为最终的图标名称。

2. 自动同步图标脚本文件

在 `internals\automate` 文件夹中打开终端,然后执行脚本,会将 `packages/theme/src/svgs` 目录中的所有图标同步到`packages\vue-icon`中去。

```bash
 pnpm run build-svgs
```

3. 发布图标库

在 `packages\vue-icon`目录中发布即可。
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall