AgentSkillsCN

styling-guide

样式设计模式(设计令牌、主题化以及统一的组件样式)。关键词:CSS、样式、设计令牌、主题化、CSS Modules、Tailwind。

SKILL.md
--- frontmatter
name: styling-guide
description: "Styling patterns (design tokens, theming, and consistent component styling). Keywords: css, styling, design tokens, theming, css modules, tailwind."

Styling Guide

This skill provides styling guidelines that work across common approaches (CSS modules, CSS-in-JS, utility classes, design systems).


1. Principles

  • Prefer a consistent approach across the app.
  • Use design tokens (spacing, colors, typography) to avoid "magic numbers".
  • Keep component styling colocated unless it becomes large.

2. Colocation rule of thumb

  • Small styles (< ~100 lines): inline or colocated in the component file
  • Larger styles: separate *.styles.ts / *.module.css / similar (depending on stack)

3. Accessibility considerations

  • Ensure sufficient color contrast.
  • Preserve focus outlines (or provide accessible alternatives).
  • Avoid conveying meaning by color alone.