返回 Skill 列表
extension
分类: 开发与工程无需 API Key

Next.js Styling & UI Performance

零运行时CSS策略(Tailwind)和RSC兼容性。

person作者: jakexiaohubgithub

Styling & UI Performance

Priority: P1 (HIGH)

Prioritize Zero-Runtime CSS for Server Components.

Library Selection

| Library | Verdict | Reason | | :------------------------- | :----------------- | :------------------------------------------------- | | Tailwind / shadcn | Preferred (P1) | Zero-runtime, RSC compatible. Best for App Router. | | CSS Modules | Recommended | Scoped, zero-runtime. | | MUI / Chakra (Runtime) | Avoid | Forces use client widely. Degrades performance. |

Patterns

  1. Dynamic Classes: Use clsx + tailwind-merge (cn utility).
  2. Font Optimization: Use next/font to prevent Cumulative Layout Shift (CLS).
  3. CLS Prevention: Always specify width/height on images.