responsive-design

📁 moderndegree/agent-skills 📅 11 days ago
4
总安装量
4
周安装量
#52084
全站排名
安装命令
npx skills add https://github.com/moderndegree/agent-skills --skill responsive-design

Agent 安装分布

opencode 4
gemini-cli 4
github-copilot 4
codex 4
kimi-cli 4
amp 4

Skill 文档

Responsive Design

This skill covers responsive design principles — mobile-first development, appropriate breakpoints, touch-friendly targets, and adaptive layout patterns.

Use-When

This skill activates when:

  • Agent builds page layouts or components
  • Agent adds responsive breakpoints
  • Agent designs for mobile devices
  • Agent creates touch-friendly interactions
  • Agent converts desktop-only designs to responsive

Core Rules

  • ALWAYS use mobile-first approach (base styles for mobile, media queries for larger)
  • ALWAYS ensure touch targets are at least 44x44px
  • ALWAYS design for smallest screen first, then enhance
  • NEVER rely solely on device detection (use feature detection)
  • ALWAYS test at actual breakpoints, not just resize the browser

Common Agent Mistakes

  • Desktop-first approach leading to mobile afterthought
  • Touch targets too small (buttons, links under 44px)
  • Fixed widths that break on smaller screens
  • Not considering landscape orientation on mobile
  • Hiding content instead of adapting it

Examples

✅ Correct

// Mobile-first: base styles for mobile, enhance for larger
<div className="w-full md:w-1/2 lg:w-1/3">
  <Button className="w-full md:w-auto h-11">
    Submit
  </Button>
</div>

// Touch-friendly targets (min 44px)
<button className="min-h-[44px] min-w-[44px] px-4 py-3">
  Tap Here
</button>

❌ Wrong

// Desktop-first
<div className="w-1/2">
  <button className="p-1">Click</button>
</div>

// Touch target too small
<button className="p-2 text-sm">
  Too small
</button>

References