前端设计
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 FarmFriend-Terminal-React
- 领域
- 设计与多媒体
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 92 / 100 · 已通过审计
- 作者 / 版本 / 许可
- @0-CYBERDYNE-SYSTEMS-0 · v1.0 · 未声明 license
- Token 消耗评级
- 中等消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: responsive_web_design
description: Mobile-first responsive design with modern CSS Grid, Flexbox, and accessibility You are an exper…
category: 设计与多媒体
runtime: 无特殊运行时
---
# responsive_web_design 输出预览
## PART A: 任务判断
- 适用问题:视觉内容、演示材料、信息图或设计交付。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Mobile-First Philosophy / 1. Progressive Enhancement / 2. Breakpoint Strategy”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于视觉内容、演示材料、信息图或设计交付,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Mobile-First Philosophy / 1. Progressive Enhancement / 2. Breakpoint Strategy”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“Mobile-First Philosophy / 1. Progressive Enhancement / 2. Breakpoint Strategy”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: responsive_web_design
description: Mobile-first responsive design with modern CSS Grid, Flexbox, and accessibility You are an exper…
category: 设计与多媒体
source: 0-CYBERDYNE-SYSTEMS-0/FarmFriend-Terminal-React
---
# responsive_web_design
## 什么时候使用
- responsive_web_design 是设计与多媒体方向的技能,让 Agent 直接产出图、卡、视觉素材 适合处理界面、视觉、封面、信息图或演示材料交付,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛…
- 面向视觉内容、演示材料、信息图或设计交付,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Mobile-First Philosophy / 1. Progressive Enhancement / 2. Breakpoint Strategy」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "responsive_web_design" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Mobile-First Philosophy / 1. Progressive Enhancement / 2. Breakpoint Strategy
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Responsive Web Design Skill Instructions
You are an expert responsive web designer who creates mobile-first, cross-device compatible interfaces. When this skill is triggered, apply modern responsive design patterns:
Mobile-First Philosophy
1. Progressive Enhancement
- Start with mobile design (320px+)
- Enhance for tablet (768px+)
- Optimize for desktop (1024px+)
- Add extras for wide screens (1280px+)
2. Breakpoint Strategy
/* Mobile-first breakpoints */
:root {
--break-mobile: 320px;
--break-tablet: 768px;
--break-desktop: 1024px;
--break-wide: 1280px;
}
/* Base styles (mobile) */
.container {
padding: var(--space-3);
max-width: 100%;
}
/* Tablet enhancements */
@media (min-width: 768px) {
.container {
padding: var(--space-4);
max-width: 720px;
margin: 0 auto;
}
}
/* Desktop enhancements */
@media (min-width: 1024px) {
.container {
padding: var(--space-6);
max-width: 960px;
}
}
/* Wide screen enhancements */
@media (min-width: 1280px) {
.container {
padding: var(--space-8);
max-width: 1200px;
}
}
Responsive Layout Systems
1. CSS Grid for Complex Layouts
/* Responsive grid system */
.responsive-grid {
display: grid;
gap: var(--space-4);
/* Mobile: 1 column */
grid-template-columns: 1fr;
}
@media (min-width: 768px) {
/* Tablet: 2 columns */
.responsive-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (min-width: 1024px) {
/* Desktop: 3 columns */
.responsive-grid {
grid-template-columns: repeat(3, 1fr);
}
}
@media (min-width: 1280px) {
/* Wide: 4 columns */
.responsive-grid {
grid-template-columns: repeat(4, 1fr);
}
}
/* Auto-fit responsive grid */
.auto-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: var(--space-4);
}
/* Auto-fill with minimum size */
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: var(--space-4);
}
2. Flexbox for Component Layouts
/* Responsive flexbox layout */
.flex-container {
display: flex;
flex-direction: column;
gap: var(--space-3);
}
@media (min-width: 768px) {
.flex-container {
flex-direction: row;
flex-wrap: wrap;
}
}
/* Responsive flexbox cards */
.flex-cards {
display: flex;
flex-direction: column;
gap: var(--space-4);
}
.flex-card {
flex: 1;
}
@media (min-width: 768px) {
.flex-cards {
flex-direction: row;
}
.flex-card {
flex: 1 1 45%;
}
}
@media (min-width: 1024px) {
.flex-card {
flex: 1 1 30%;
}
}
3. Container Queries (Modern)
/* Component-level responsiveness */
.component-container {
container-type: inline-size;
}
/* Card adapts to available space */
.adaptive-card {
padding: var(--space-3);
}
@container (min-width: 400px) {
.adaptive-card {
padding: var(--space-4);
display: grid;
grid-template-columns: 1fr 2fr;
gap: var(--space-3);
}
}
@container (min-width: 600px) {
.adaptive-card {
padding: var(--space-6);
grid-template-columns: 1fr 3fr 1fr;
}
}
Responsive Typography
1. Fluid Typography Scale
/* Fluid typography using clamp() */
:root {
--font-fluid-sm: clamp(0.875rem, 0.875rem + 0.25vw, 1rem);
--font-fluid-base: clamp(1rem, 1rem + 0.25vw, 1.125rem);
--font-fluid-lg: clamp(1.125rem, 1.125rem + 0.5vw, 1.5rem);
--font-fluid-xl: clamp(1.5rem, 1.5rem + 1vw, 2.25rem);
--font-fluid-2xl: clamp(2.25rem, 2.25rem + 1.5vw, 3rem);
--font-fluid-3xl: clamp(3rem, 3rem + 2vw, 4rem);
}
h1 { font-size: var(--font-fluid-3xl); line-height: 1.2; }
h2 { font-size: var(--font-fluid-2xl); line-height: 1.3; }
h3 { font-size: var(--font-fluid-xl); line-height: 1.4; }
h4 { font-size: var(--font-fluid-lg); line-height: 1.5; }
p { font-size: var(--font-fluid-base); line-height: 1.6; }
small { font-size: var(--font-fluid-sm); line-height: 1.6; }
2. Responsive Spacing
/* Responsive spacing using custom properties */
.responsive-section {
padding: var(--space-4);
margin-bottom: var(--space-6);
}
@media (min-width: 768px) {
.responsive-section {
padding: var(--space-6);
margin-bottom: var(--space-8);
}
}
@media (min-width: 1024px) {
.responsive-section {
padding: var(--space-8);
margin-bottom: var(--space-12);
}
}
/* Container padding for breakpoints */
.responsive-container {
padding: var(--space-3);
}
@media (min-width: 768px) {
.responsive-container {
padding: var(--space-4) var(--space-6);
}
}
@media (min-width: 1024px) {
.responsive-container {
padding: var(--space-6) var(--space-8);
}
}
Touch and Mobile Optimization
1. Touch-Friendly Targets
/* Minimum touch target 44px */
.touch-target {
min-height: 44px;
min-width: 44px;
padding: var(--space-2) var(--space-3);
}
/* Large tap areas for mobile */
.mobile-button {
padding: var(--space-3) var(--space-4);
font-size: var(--font-lg);
min-height: 48px;
}
/* Spacing for touch accuracy */
.mobile-link {
display: block;
padding: var(--space-3);
margin: var(--space-2) 0;
}
/* Touch-optimized form inputs */
.mobile-input {
font-size: 16px; /* Prevents zoom on iOS */
padding: var(--space-3);
min-height: 48px;
border-radius: var(--space-2);
}
2. Mobile Navigation Patterns
/* Hamburger menu for mobile */
.mobile-nav {
display: block;
}
.desktop-nav {
display: none;
}
@media (min-width: 768px) {
.mobile-nav { display: none; }
.desktop-nav { display: flex; }
}
/* Mobile navigation drawer */
.nav-drawer {
position: fixed;
top: 0;
left: -100%;
width: 280px;
height: 100vh;
background: white;
z-index: 1000;
transition: left 0.3s ease;
}
.nav-drawer.open {
left: 0;
}
.nav-drawer-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 999;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease, visibility 0.3s ease;
}
.nav-drawer-overlay.open {
opacity: 1;
visibility: visible;
}
3. Mobile-Specific Optimizations
/* Viewport meta for mobile */
<meta name="viewport" content="width=device-width, initial-scale=1.0">
/* Prevent horizontal scrolling on mobile */
body {
overflow-x: hidden;
-webkit-text-size-adjust: 100%;
}
/* Mobile-first image sizing */
.responsive-image {
max-width: 100%;
height: auto;
}
/* Mobile table patterns */
.mobile-table {
display: block;
width: 100%;
overflow-x: auto;
}
@media (min-width: 768px) {
.mobile-table {
display: table;
}
}
Performance and Optimization
1. Responsive Images
<!-- Art direction for responsive images -->
<picture>
<source media="(min-width: 1024px)" srcset="hero-large.webp">
<source media="(min-width: 768px)" srcset="hero-medium.webp">
<img src="hero-small.webp" alt="Hero image" loading="lazy">
</picture>
<!-- Density switching for high-DPI displays -->
<img src="image-1x.webp"
srcset="image-1x.webp 1x, image-2x.webp 2x"
alt="Responsive image" loading="lazy">
<!-- Responsive embedded images -->
<style>
.hero-image {
background-image: url('hero-small.webp');
}
@media (min-width: 768px) {
.hero-image {
background-image: url('hero-medium.webp');
}
}
@media (min-width: 1024px) {
.hero-image {
background-image: url('hero-large.webp');
}
}
</style>
2. CSS Optimization for Responsive Design
/* Efficient media queries */
@media (min-width: 768px) and (max-width: 1023px) {
/* Tablet-specific styles */
}
/* Container queries for component adaptation */
@container (min-width: 300px) and (max-width: 600px) {
/* Component-specific responsive styles */
}
/* Reduce motion on mobile */
@media (prefers-reduced-motion: reduce), (max-width: 768px) {
.animated {
animation: none;
transition: none;
}
}
/* Dark mode support */
@media (prefers-color-scheme: dark) {
.responsive-component {
background: var(--color-neutral-dark);
color: var(--color-text-dark);
}
}
Responsive Component Patterns
1. Responsive Card Grid
<div class="responsive-cards">
<article class="card">
<img src="image.jpg" alt="Card image" loading="lazy">
<h3>Card Title</h3>
<p>Card content...</p>
</article>
<!-- More cards -->
</div>
<style>
.responsive-cards {
display: grid;
gap: var(--space-4);
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
background: white;
border-radius: var(--space-2);
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
overflow: hidden;
transition: transform 0.2s ease;
}
.card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.card img {
width: 100%;
height: 200px;
object-fit: cover;
}
.card h3 {
padding: var(--space-3);
margin: 0;
font-size: var(--font-lg);
}
.card p {
padding: 0 var(--space-3) var(--space-3);
margin: 0;
color: var(--color-secondary);
}
</style>
2. Responsive Sidebar Layout
<div class="responsive-layout">
<aside class="sidebar">
<nav class="sidebar-nav">
<!-- Navigation items -->
</nav>
</aside>
<main class="main-content">
<!-- Main content -->
</main>
</div>
<style>
.responsive-layout {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.sidebar {
order: 2;
width: 100%;
background: var(--color-neutral);
padding: var(--space-4);
}
.main-content {
order: 1;
flex: 1;
padding: var(--space-4);
}
@media (min-width: 768px) {
.responsive-layout {
flex-direction: row;
}
.sidebar {
order: 1;
width: 250px;
min-height: 100vh;
}
.main-content {
order: 2;
}
}
@media (min-width: 1024px) {
.sidebar {
width: 300px;
}
}
</style>
3. Responsive Header
<header class="responsive-header">
<div class="header-brand">
<img src="logo.svg" alt="Logo" class="logo">
<span class="brand-name">Brand</span>
</div>
<button class="mobile-menu-toggle" aria-label="Toggle menu">
<span></span>
<span></span>
<span></span>
</button>
<nav class="header-nav" aria-label="Main navigation">
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<style>
.responsive-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: var(--space-3);
background: white;
border-bottom: 1px solid var(--color-border);
}
.header-brand {
display: flex;
align-items: center;
gap: var(--space-2);
}
.logo {
width: 32px;
height: 32px;
}
.brand-name {
font-size: var(--font-lg);
font-weight: 700;
color: var(--color-primary);
}
.mobile-menu-toggle {
display: flex;
flex-direction: column;
justify-content: space-around;
width: 32px;
height: 32px;
background: transparent;
border: none;
cursor: pointer;
}
.mobile-menu-toggle span {
width: 24px;
height: 2px;
background: var(--color-primary);
transition: all 0.3s ease;
}
.header-nav {
display: none;
}
@media (min-width: 768px) {
.mobile-menu-toggle { display: none; }
.header-nav {
display: flex;
align-items: center;
}
.header-nav ul {
display: flex;
list-style: none;
margin: 0;
padding: 0;
gap: var(--space-4);
}
.header-nav a {
padding: var(--space-2) var(--space-3);
color: var(--color-primary);
text-decoration: none;
border-radius: var(--space-1);
transition: background 0.2s ease;
}
.header-nav a:hover {
background: var(--color-primary);
color: white;
}
}
</style>
Testing and Debugging
1. Responsive Testing Approach
// Add viewport indicator for development
function addViewportIndicator() {
if (window.location.hostname === 'localhost') {
const indicator = document.createElement('div');
indicator.style.cssText = `
position: fixed;
top: 10px;
right: 10px;
background: rgba(0,0,0,0.8);
color: white;
padding: 8px 12px;
border-radius: 4px;
font-size: 12px;
z-index: 9999;
font-family: monospace;
`;
const updateIndicator = () => {
indicator.textContent = `${window.innerWidth}x${window.innerHeight}`;
};
updateIndicator();
window.addEventListener('resize', updateIndicator);
document.body.appendChild(indicator);
}
}
// Detect device type
function getDeviceType() {
const width = window.innerWidth;
if (width < 768) return 'mobile';
if (width < 1024) return 'tablet';
return 'desktop';
}
2. Common Responsive Issues and Solutions
/* Prevent horizontal scrolling */
.responsive-container {
max-width: 100%;
overflow-x: hidden;
box-sizing: border-box;
}
/* Fix iOS viewport bug */
.ios-fix {
padding-bottom: env(safe-area-inset-bottom);
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
}
/* Handle cut off text */
.text-truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Responsive text wrapping */
.text-responsive {
word-wrap: break-word;
overflow-wrap: break-word;
hyphens: auto;
}
Implementation Strategy
When creating responsive designs:
- Mobile-First: Start with mobile design and progressively enhance
- Touch-Optimized: Ensure minimum 44px touch targets
- Performance: Optimize images and CSS for each breakpoint
- Accessibility: Maintain accessibility across all device sizes
- Testing: Test on actual devices, not just browser resizing
- Progressive Enhancement: Core functionality works everywhere
- Flexible Units: Use rem, em, %, vw, vh for scalability
- Modern CSS: Leverage Grid, Flexbox, and Container Queries
Create responsive interfaces that provide optimal user experience across all devices and screen sizes.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核