css-development
使用 Tailwind 语义化模式创建和重构 CSS
También disponible en: 2389-research
在项目中管理一致的 CSS 样式既困难又容易出错。此技能将指导您创建语义化组件类、添加深色模式支持以及维护测试覆盖率。
Descargar el ZIP de la skill
Subir en Claude
Ve a Configuración → Capacidades → Skills → Subir skill
Activa y empieza a usar
Pruébalo
Usando "css-development". Create a card component for displaying user profiles
Resultado esperado:
- 在 styles/components.css 中创建了 .card-profile 类
- 为背景和文本颜色添加了深色模式变体
- 编写了静态 CSS 测试以验证类的存在
- 提供了 React 和 HTML 示例的使用模式文档
Usando "css-development". Validate the CSS in our components.css file
Resultado esperado:
- 共找到 12 个类,识别出 3 个问题
- 问题:.btn-blue 使用了工具类命名而非语义化命名
- 问题:.card-header 缺少深色模式变体
- 建议:重命名为 .button-secondary 并添加 dark:bg-gray-800
Auditoría de seguridad
SeguroThis skill is a documentation-only workflow guide for CSS development. All 281 static findings are false positives caused by pattern matching on markdown code examples. The backtick detections match markdown formatting, not shell execution. Cryptographic algorithm detections match file extensions. No executable code, network requests, or file system operations exist in this skill.
Factores de riesgo
⚙️ Comandos externos (240)
📁 Acceso al sistema de archivos (5)
🌐 Acceso a red (1)
Puntuación de calidad
Lo que puedes crear
创建新的样式组件
从头开始构建新的按钮、卡片或表单组件,包含语义化命名、深色模式支持和适当的测试覆盖率。
审核 CSS 代码库的一致性
审查现有样式表,识别命名问题、缺失的深色模式变体以及合并优化的机会。
将工具类重构为语义化 CSS
将标记中分散的 Tailwind 工具类转换为可维护的语义化组件类,并提供文档。
Prueba estos prompts
Create a button-secondary component that matches our button-primary style but with a gray background for less prominent actions.
Review the CSS in styles/components.css and check if it follows our semantic naming and dark mode patterns.
Refactor the inline Tailwind classes in src/components/Card.tsx to use semantic component classes.
Add dark mode support to all component classes in styles/components.css that are missing dark: variants.
Mejores prácticas
- 在创建新类之前始终检查现有的 components.css 以实现重用
- 为所有背景、文本和边框颜色添加 dark: 变体
- 编写静态 CSS 测试和组件渲染测试以实现完整覆盖
Evitar
- 创建工具类风格的类名,如 .btn-blue 或 .card-sm,而不是语义化名称
- 添加 CSS 类时没有相应的测试覆盖
- 在有颜色或交互的元素上跳过深色模式变体