frontend-css
使用现代方法学编写可维护、高性能的CSS,包括Tailwind CSS工具类、CSS模块、CSS-in-JS或设计系统令牌。在样式化组件、创建布局、实现设计系统或处理CSS文件(.css, .scss, .module.css)、Tailwind配置、styled-components或CSS-in-JS解决方案时使用此技能。在实现Tailwind的优先工具模式、使用CSS自定义属性进行主题化、使用flexbox/grid创建响应式布局、管理设计令牌(颜色、间距、排版)或使用purging和tree-shaking优化CSS用于生产时应用此技能。此技能确保项目中的样式方法一致,在存在框架工具时最小化自定义CSS,维护设计系统一致性,并遵循现代CSS最佳实践,包括容器查询、CSS变量和性能优化。
📖 中文导读:使用现代方法学编写可维护、高性能的CSS,包括Tailwind CSS工具类、CSS模块、CSS-in-JS或设计系统令牌。在样式化组件、创建布局、实现设计系统或处理CSS文件(.css, .scss, .module.css)、Tailwind配置、styled-components或CSS-in-JS解决方案时使用此技能。在实现Tailwind的优先工具模式、使用CSS自定义属性进行主题化、使用flexbox/grid创建响应式布局、管理设计令牌(颜色、间距、排版)或使用purging和tree-shaking优化CSS用于生产时应用此技能。此技能确保项目中的样式方法一致,在存在框架工具时最小化自定义CSS,维护设计系统一致性,并遵循现代CSS最佳实践,包括容器查询、CSS变量和性能优化。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: Frontend CSS description: Write maintainable, performant CSS using modern methodologies including Tailwind CSS utility classes, CSS modules, CSS-in-JS, or design system tokens. Use this skill when styling components, creating layouts, implementing design systems, or working with CSS files (.css, .scss, .module.css), Tailwind configuration, styled-components, or CSS-in-JS solutions. Apply this skill when implementing utility-first patterns with Tailwind, using CSS custom properties for theming, creating responsive layouts with flexbox/grid, managing design tokens (colors, spacing, typography), or optimizing CSS for production with purging and tree-shaking. This skill ensures consistent styling methodology across the project, minimizes custom CSS when framework utilities exist, maintains design system coherence, and follows modern CSS best practices including container queries, CSS variables, and performance optimization.
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 writing CSS styles in .css, .scss, .module.css, or styled-components files
- When applying Tailwind CSS utility classes to components (className="flex justify-center...")
- When configuring Tailwind design tokens in tailwind.config.js (colors, spacing, breakpoints)
- When implementing CSS modules for scoped component styling
- When using CSS-in-JS solutions (styled-components, Emotion, CSS modules)
- When creating or maintaining design system tokens (CSS custom properties/variables)
- When implementing theming systems with CSS variables or Tailwind's dark mode
- When styling layouts using modern CSS (flexbox, grid, container queries)
- When ensuring consistent methodology (BEM, utility-first, CSS modules) across the project
- When optimizing CSS bundle size with purging, tree-shaking, or critical CSS extraction
- When implementing responsive utilities or custom responsive breakpoints
- When working with CSS preprocessors (Sass, Less) or PostCSS configurations
- When avoiding framework style overrides and working with the chosen CSS methodology
- When ensuring CSS performance and avoiding specificity conflicts
Instructions
For details, refer to the information provided in this file: frontend CSS