指导在前端项目中正确使用 Ant Design 与自定义主题 CSS 变量,避免硬编码颜色并保证暗色/浅色主题切换一致性。当前端编写或修改样式时使用本技能。
当你在:
请使用本技能,并同时遵守 .agents/rules/04-组件规范.md 与 .agents/rules/08-样式规范.md。
在 SCSS 中直接使用:
color: var(--ant-color-text);
background-color: var(--ant-color-bg-container);
border-color: var(--ant-color-border);
常见变量举例:
var(--ant-color-primary)var(--ant-color-text)var(--ant-color-bg-container)var(--ant-color-border)项目中可以定义自有变量,例如:
var(--shentu-card-bg)var(--shentu-border-radius)var(--shentu-cn-family)在组件样式中的使用:
.card {
background-color: var(--shentu-card-bg);
border-radius: var(--shentu-border-radius);
font-family: var(--shentu-cn-family);
}
// ❌ 硬编码颜色,不随主题变化
.button {
background-color: #1677ff;
color: #ffffff;
}
var(--xxx) 变量?Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer