AgentSkillsCN

Frontend CSS

采用一致的方法论、设计系统、框架实用工具,并尽量减少自定义样式,以编写性能更优、更易维护的 CSS。在编写或修改 CSS 文件、样式模块、Tailwind 类、styled-components、CSS-in-JS,或为 UI 组件编写任何样式代码时,均可运用此技能。无论是应用实用类、维护颜色/间距/排版等设计令牌,还是借助 Tailwind 或 Bootstrap 等 CSS 框架进行开发,避免覆盖框架样式、通过 Purge/Tree Shaking 优化生产环境下的 CSS,或是实现响应式布局,皆可借助此技能轻松完成。当处理 .css、.scss、.module.css 文件,或为组件添加 className/ style 属性时,此技能同样至关重要。

SKILL.md
--- frontmatter
name: Frontend CSS
description: Write and maintain CSS using consistent methodology, design systems, framework utilities, and minimal custom styles for better performance and maintainability. Use this skill when writing or modifying CSS files, style modules, Tailwind classes, styled-components, CSS-in-JS, or any styling code for UI components. Use this when applying utility classes, maintaining design tokens for colors/spacing/typography, working with CSS frameworks like Tailwind or Bootstrap, avoiding framework style overrides, optimizing CSS for production with purging/tree-shaking, or implementing responsive styling. Use this when working on .css, .scss, .module.css files or when adding className/style attributes to components.

Frontend CSS

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle frontend CSS.

When to use this skill:

  • When creating or editing CSS files (.css, .scss, .sass, .less, .module.css)
  • When applying CSS framework utility classes (Tailwind, Bootstrap, etc.) to components
  • When writing styled-components, CSS-in-JS, or inline styles in component files
  • When maintaining design tokens and design system variables (colors, spacing, typography)
  • When implementing consistent CSS methodology (BEM, utility-first, CSS modules)
  • When avoiding excessive custom CSS by leveraging framework patterns and utilities
  • When ensuring CSS performance through purging unused styles and tree-shaking
  • When adding responsive styling and breakpoint-specific styles
  • When working with global stylesheets or component-scoped styles
  • When refactoring to reduce custom CSS and align with framework conventions
  • When setting up CSS configuration files (tailwind.config.js, postcss.config.js)

Instructions

For details, refer to the information provided in this file: frontend CSS