Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问clear审计通过

frontend-responsive-design-standards前端响应式设计标准

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

24,025

周安装

828

GitHub Stars

902

下载量

10,882
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:frontend-responsive-design-standards(前端响应式设计标准)
来源仓库:https://github.com/am-will/codex-skills
仓库路径:skills/frontend-responsive-design-standards
安装命令:
npx skills add https://github.com/am-will/codex-skills --skill 'Frontend Responsive Design Standards'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/am-will/codex-skills --skill 'Frontend Responsive Design Standards'

简介

移动优先的响应式布局,具有流体容器、相关单元和跨所有屏幕尺寸的触摸友好设计。

  • 从移动布局开始,然后使用最小宽度增强更大的屏幕
  • 媒体查询;一致使用项目标准断点(例如 Tailwind 的 640px、768px、1024px)
  • 使用百分比宽度、flexbox 和 CSS 网格而不是固定像素尺寸构建流体布局;使用最大宽度
  • 容器和 1fr
  • 网格列
  • 对版式和间距应用相对单位(rem/em),以根据根字体大小进行缩放;保持最小 16 像素正文文本和 44x44 像素触摸目标,以实现移动可访问性
  • 使用 srcset 优化图像
  • 和现代格式(WebP、AVIF);通过隐藏次要元素并使用 Flexbox/Grid 顺序重新排序来确定移动设备上内容的优先级
  • 财产
  • 在关键断点(375px、768px、1024px、1440px)处测试布局,以捕获水平滚动、重叠元素和可读性问题

SKILL.md

Frontend Responsive Design Standards

Rule: Mobile-first development with consistent breakpoints, fluid layouts, relative units, and touch-friendly targets.

When to use this skill

  • When creating or modifying layouts that need to work on mobile, tablet, and desktop
  • When implementing mobile-first design patterns starting with mobile layout
  • When writing media queries or breakpoint-specific styles
  • When using flexible units (rem, em, %) instead of fixed pixels for scalability
  • When implementing fluid layouts with percentage-based widths or flexbox/grid
  • When ensuring touch targets meet minimum size requirements (44x44px) for mobile
  • When optimizing images and assets for different screen sizes and mobile networks
  • When testing UI across multiple device sizes and breakpoints
  • When maintaining readable typography across all screen sizes
  • When prioritizing content display on smaller screens through layout decisions
  • When using responsive design utilities in CSS frameworks (Tailwind, Bootstrap responsive classes)

This Skill provides Codex with specific guidance on how to adhere to coding standards as they relate to how it should handle frontend responsive.

Mobile-First Development - Mandatory

Always start with mobile layout, then enhance for larger screens.

Bad (desktop-first):

.container {
  width: 1200px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .container {
    width: 100%;
    grid-template-columns: 1fr;
  }
}

Good (mobile-first):

.container {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
    grid-template-columns: repeat(4, 1fr);
  }
}

Why mobile-first:

  • Forces content prioritization
  • Better performance on mobile (no overriding)
  • Progressive enhancement over graceful degradation

Standard Breakpoints

Identify and use project breakpoints consistently:

Common breakpoint systems:

Tailwind:

sm: 640px   (small tablets)
md: 768px   (tablets)
lg: 1024px  (laptops)
xl: 1280px  (desktops)
2xl: 1536px (large desktops)

Bootstrap:

sm: 576px
md: 768px
lg: 992px
xl: 1200px
xxl: 1400px

Check existing codebase for breakpoint definitions before creating new ones.

Usage (Tailwind):

<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4">

Usage (CSS):

@media (min-width: 768px) { }
@media (min-width: 1024px) { }

Never use arbitrary breakpoints like 850px or 1150px unless explicitly required.

Fluid Layouts

Use flexible containers that adapt to screen size:

Bad (fixed widths):

.container { width: 1200px; }
.sidebar { width: 300px; }
.content { width: 900px; }

Good (fluid):

.container {
  width: 100%;
  max-width: 1200px;
  padding: 0 1rem;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: 300px 1fr;
  }
}

Patterns for fluid layouts:

  • Flexbox: flex: 1, flex-grow, flex-shrink
  • Grid: 1fr, minmax(), auto-fit, auto-fill
  • Percentage widths: width: 100%, max-width: 1200px
  • Container queries (modern): @container (min-width: 400px)

Relative Units Over Fixed Pixels

Use rem/em for scalability and accessibility:

Bad:

font-size: 16px;
padding: 20px;
margin: 10px;
border-radius: 8px;

Good:

font-size: 1rem;      /* 16px base */
padding: 1.25rem;     /* 20px */
margin: 0.625rem;     /* 10px */
border-radius: 0.5rem; /* 8px */

When to use each unit:

  • rem: Font sizes, spacing, layout dimensions (scales with root font size)
  • em: Component-relative sizing (scales with parent font size)
  • %: Widths, heights relative to parent
  • px: Borders (1px), shadows, very small values
  • vw/vh: Full viewport dimensions, hero sections
  • ch: Text-based widths (e.g., max-width: 65ch for readable line length)

Framework utilities handle this automatically:

<div className="text-base p-5 m-2.5 rounded-lg">

Touch-Friendly Design

Minimum touch target size: 44x44px (iOS) / 48x48px (Android)

Bad:

.icon-button {
  width: 24px;
  height: 24px;
}

Good:

.icon-button {
  width: 24px;
  height: 24px;
  padding: 12px; /* Total: 48x48px */
  /* Or use min-width/min-height */
  min-width: 44px;
  min-height: 44px;
}

Touch target checklist:

  • Buttons minimum 44x44px
  • Links in text have adequate spacing
  • Form inputs have sufficient height (min 44px)
  • Icon buttons have padding for larger hit area
  • Spacing between interactive elements (min 8px)

Readable Typography

Maintain readable font sizes without zoom:

Bad:

body { font-size: 12px; }
.small-text { font-size: 10px; }

Good:

body { font-size: 1rem; } /* 16px minimum */
.small-text { font-size: 0.875rem; } /* 14px minimum */

Typography guidelines:

  • Body text: 16px (1rem) minimum
  • Small text: 14px (0.875rem) minimum
  • Line height: 1.5 for body, 1.2 for headings
  • Line length: 45-75 characters (use max-width: 65ch)
  • Contrast: WCAG AA minimum (4.5:1 for normal text)

Responsive typography:

h1 {
  font-size: 2rem;
}

@media (min-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 3rem;
  }
}

Or with clamp (fluid):

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

Content Priority on Mobile

Show most important content first, hide or collapse secondary content:

Bad:

<div>
  <Sidebar /> {/* Full sidebar on mobile */}
  <MainContent />
</div>

Good:

<div className="flex flex-col lg:flex-row">
  <MainContent className="order-1" />
  <Sidebar className="order-2 hidden lg:block" />
</div>

Strategies:

  • Hide non-essential elements on mobile
  • Use hamburger menus for navigation
  • Collapse accordions/tabs for secondary content
  • Stack layouts vertically on mobile
  • Use order property to reorder content

Image Optimization

Serve appropriate images for device size:

Bad:

<img src="hero-4000x3000.jpg" alt="Hero">

Good:

<img
  src="hero-800x600.jpg"
  srcset="
    hero-400x300.jpg 400w,
    hero-800x600.jpg 800w,
    hero-1600x1200.jpg 1600w
  "
  sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 800px"
  alt="Hero"
>

Or with modern formats:

<picture>
  <source srcset="hero.avif" type="image/avif">
  <source srcset="hero.webp" type="image/webp">
  <img src="hero.jpg" alt="Hero">
</picture>

Framework-specific:

// Next.js
<Image
  src="/hero.jpg"
  width={800}
  height={600}
  sizes="(max-width: 768px) 100vw, 50vw"
  alt="Hero"
/>

Testing Across Devices

Verify layouts at key breakpoints before completing work:

Test checklist:

  • Mobile (375px - iPhone SE)
  • Mobile large (414px - iPhone Pro Max)
  • Tablet (768px - iPad)
  • Laptop (1024px)
  • Desktop (1440px)

Testing methods:

  1. Browser DevTools responsive mode
  2. Real device testing (iOS/Android)
  3. Browser extensions (Responsive Viewer)
  4. Automated visual regression tests

Common issues to check:

  • Horizontal scrolling on mobile
  • Text overflow or truncation
  • Overlapping elements
  • Unreadable font sizes
  • Touch targets too small
  • Images not loading or distorted

Common Responsive Patterns

Navigation:

// Mobile: Hamburger menu
// Desktop: Horizontal nav
<nav className="lg:flex lg:items-center">
  <button className="lg:hidden">Menu</button>
  <ul className="hidden lg:flex lg:gap-4">
    <li>Home</li>
    <li>About</li>
  </ul>
</nav>

Grid layouts:

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

Sidebar layouts:

.layout {
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .layout {
    flex-direction: row;
  }
  .sidebar { width: 300px; }
  .content { flex: 1; }
}

Verification Checklist

Before completing responsive work:

  • Started with mobile layout
  • Used project's standard breakpoints
  • Implemented fluid layouts (no fixed widths)
  • Used relative units (rem/em) for sizing
  • Touch targets minimum 44x44px
  • Typography readable without zoom (16px+ body)
  • Prioritized content on mobile
  • Optimized images for different sizes
  • Tested at all key breakpoints
  • No horizontal scrolling on mobile
  • No overlapping or truncated content

Quick Reference

SituationAction
Starting new layoutBegin with mobile (320-375px)
Need breakpointUse project standard (check existing code)
Setting widthUse width: 100% + max-width
Setting font sizeUse rem (16px = 1rem)
Setting spacingUse rem or framework utilities
Button too smallEnsure min 44x44px with padding
Text too smallMinimum 16px (1rem) for body
Testing layoutCheck 375px, 768px, 1024px, 1440px
Images loading slowUse srcset and modern formats

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

30.38%
按下载量换算3,306

Claude Code

24.32%
按下载量换算2,647

OpenCode

17.91%
按下载量换算1,949

Gemini CLI

12.51%
按下载量换算1,361

Antigravity

7.88%
按下载量换算858

windsurf

3.66%
按下载量换算398

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源字段存在多来源差异,先按来源优先级自动处理,无法消解时进入异常复核队列。

来源信息

继续浏览同类 Skills