css

编写CSS的最佳实践和指南,包括CSS模块和现代CSS功能。

📖 中文导读:编写CSS的最佳实践和指南,包括CSS模块和现代CSS功能。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: css description: Writes CSS and CSS Modules with modern features. Use when writing stylesheets, CSS modules, or styling components.

CSS Protocol

Modern Features

Use nesting, :has(), &, &:hover, nested @media

.button {
  color: blue;

  &:hover {
    color: darkblue;
  }

  @media (max-width: 600px) {
    width: 100%;
  }
}

CSS Modules

  • camelCase class names only (no dashes)
  • No tag selectors at root level
  • No nested class/id selectors
  • Nest pseudo-classes, pseudo-elements, @media with &
/* ✓ Good */
.container { ... }
.headerTitle { ... }
.submitButton { ... }