responsive-design
Skill1 starsChanged 48 days agoMITView on GitHub
响应式实现手册:容器查询、clamp() 流式排版与间距、CSS Grid/Flex 响应式布局、 移动优先断点策略、响应式导航、响应式图片与表格、视口单位(dvh/svh/lvh)与常见坑。 触发词:响应式、自适应、移动端适配、断点、媒体查询、container query、容器查询、 流式排版、fluid typography、clamp、移动端布局、手机端、平板、横屏、视口高度、100vh问题 不用于:设计基础规范(走 ui-design);无障碍合规审计(走 accessibility-audit)
We split this skill into the rules it gives an agent
6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 29 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 420
Mobile-First: Write base styles for mobile, enhance for larger screens
- Very specific: line 422
Fluid Over Fixed: Prefer clamp() and relative units over fixed px
- Distinctive: line 423
Container Queries: Use for component-level responsiveness
- Very specific: line 426
Logical Properties: Use inline/block for internationalization
- Very specific: line 444
Use px for typography (use rem)
- Very specific: line 447
Use 100vh on mobile without fallback
“Common” is measured: kept by at least 6 in 10 of the 29 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Responsive Design
Modern responsive CSS patterns using container queries, fluid typography, CSS Grid, and mobile-first strategies.
WHAT
Comprehensive responsive design techniques:
- Container queries for component-level responsiveness
- Fluid typography and spacing with
clamp() - CSS Grid and Flexbox layout patterns
- Mobile-first breakpoint strategies
- Responsive images and media
- Viewport units and dynamic sizing
WHEN
- Building layouts that adapt across screen sizes
- Creating reusable components that respond to container size
- Implementing fluid typography scales
- Setting up responsive grid systems
- Handling mobile navigation patterns
- Optimizing images for different devices
KEYWORDS
responsive, container query, media query, breakpoint, mobile-first, fluid typography, clamp, css grid, flexbox, viewport, adaptive, responsive images
Installation
OpenClaw / Moltbot / Clawbot
npx clawhub@latest install responsive-designBreakpoint Scale (Mobile-First)
/* Base: Mobile (< 640px) - no media query needed */
@media (min-width: 640px) { /* sm: Large phones, small tablets */ }
@media (min-width: 768px) { /* md: Tablets */ }
@media (min-width: 1024px) { /* lg: Laptops */ }
@media (min-width: 1280px) { /* xl: Desktops */ }
@media (min-width: 1536px) { /* 2xl: Large screens */ }Tailwind equivalents: sm:, md:, lg:, xl:, 2xl:
Container Queries
Component-level responsiveness independent of viewport:
/* Define containment context */
.card-container {
container-type: inline-size;
container-name: card;
}
/* Query the container, not viewport */
@container card (min-width: 400px) {
.card {
display: grid;
grid-template-columns: 200px 1fr;
}
}
@container card (min-width: 600px) {
.card-title {
font-size: 1.5rem;
}
}
/* Container query units */
.card-title {
font-size: clamp(1rem, 5cqi, 2rem); /* 5% of container inline-size */
}Tailwind Container Queries
function ResponsiveCard({ title, image, description }) {
return (
<div className="@container">
<article className="flex flex-col @md:flex-row @md:gap-4">
<img
src={image}
alt=""
className="w-full @md:w-48 @lg:w-64 aspect-video @md:aspect-square object-cover"
/>
<div className="p-4 @md:p-0">
<h2 className="text-lg @md:text-xl @lg:text-2xl font-semibold">
{title}
</h2>
<p className="mt-2 text-muted-foreground @md:line-clamp-3">
{description}
</p>
</div>
</article>
</div>
)
}Fluid Typography
CSS Custom Properties Scale
:root {
--text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
--text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
--text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
--text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
--text-xl: clamp(1.25rem, 1rem + 1.25vw, 1.5rem);
--text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
--text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem);
--text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem);
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
p { font-size: var(--text-base); }Fluid Spacing Scale
:root {
--space-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
--space-sm: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
--space-md: clamp(1rem, 0.8rem + 1vw, 1.5rem);
--space-lg: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
--space-xl: clamp(2rem, 1.5rem + 2.5vw, 4rem);
}Clamp Formula
clamp(MIN, PREFERRED, MAX)
MIN: Smallest allowed size
PREFERRED: Ideal fluid calculation (often uses vw)
MAX: Largest allowed sizeCSS Grid Responsive Layouts
Auto-Fit Grid (Items Wrap)
.grid-auto {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
gap: 1.5rem;
}Named Grid Areas
.page-layout {
display: grid;
grid-template-areas:
"header"
"main"
"sidebar"
"footer";
gap: 1rem;
}
@media (min-width: 768px) {
.page-layout {
grid-template-columns: 1fr 300px;
grid-template-areas:
"header header"
"main sidebar"
"footer footer";
}
}
@media (min-width: 1024px) {
.page-layout {
grid-template-columns: 250px 1fr 300px;
grid-template-areas:
"header header header"
"nav main sidebar"
"footer footer footer";
}
}
.header { grid-area: header; }
.main { grid-area: main; }
.sidebar { grid-area: sidebar; }
.footer { grid-area: footer; }Tailwind Grid
function ProductGrid({ products }) {
return (
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-6">
{products.map(product => (
<ProductCard key={product.id} product={product} />
))}
</div>
)
}Responsive Navigation
function ResponsiveNav({ items }) {
const [isOpen, setIsOpen] = useState(false)
return (
<nav className="relative">
{/* Mobile toggle */}
<button
className="lg:hidden p-2"
onClick={() => setIsOpen(!isOpen)}
aria-expanded={isOpen}
aria-controls="nav-menu"
>
<span className="sr-only">Toggle navigation</span>
{isOpen ? <X /> : <Menu />}
</button>
{/* Navigation links */}
<ul
id="nav-menu"
className={cn(
// Mobile: dropdown
"absolute top-full left-0 right-0 bg-background border-b",
"flex flex-col",
isOpen ? "flex" : "hidden",
// Desktop: horizontal, always visible
"lg:static lg:flex lg:flex-row lg:border-0"
)}
>
{items.map(item => (
<li key={item.href}>
<a
href={item.href}
className="block px-4 py-3 lg:px-3 lg:py-2 hover:bg-muted lg:hover:bg-transparent"
>
{item.label}
</a>
</li>
))}
</ul>
</nav>
)
}Responsive Images
Art Direction with Picture
function ResponsiveHero() {
return (
<picture>
{/* Different crops for different screens */}
<source media="(min-width: 1024px)" srcSet="/hero-wide.webp" type="image/webp" />
<source media="(min-width: 768px)" srcSet="/hero-medium.webp" type="image/webp" />
<source srcSet="/hero-mobile.webp" type="image/webp" />
<img
src="/hero-mobile.jpg"
alt="Hero description"
className="w-full h-auto"
loading="eager"
fetchPriority="high"
/>
</picture>
)
}Resolution Switching with srcset
function ProductImage({ product }) {
return (
<img
src={product.image}
srcSet={`
${product.image}?w=400 400w,
${product.image}?w=800 800w,
${product.image}?w=1200 1200w
`}
sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw"
alt={product.name}
className="w-full h-auto object-cover"
loading="lazy"
/>
)
}Responsive Tables
Horizontal Scroll Pattern
function ResponsiveTable({ data, columns }) {
return (
<div className="w-full overflow-x-auto">
<table className="w-full min-w-[600px]">
<thead>
<tr>
{columns.map(col => (
<th key={col.key} className="text-left p-3">{col.label}</th>
))}
</tr>
</thead>
<tbody>
{data.map((row, i) => (
<tr key={i} className="border-t">
{columns.map(col => (
<td key={col.key} className="p-3">{row[col.key]}</td>
))}
</tr>
))}
</tbody>
</table>
</div>
)
}Card Layout on Mobile
function ResponsiveDataTable({ data, columns }) {
return (
<>
{/* Desktop: table */}
<table className="hidden md:table w-full">
{/* standard table markup */}
</table>
{/* Mobile: cards */}
<div className="md:hidden space-y-4">
{data.map((row, i) => (
<div key={i} className="border rounded-lg p-4 space-y-2">
{columns.map(col => (
<div key={col.key} className="flex justify-between">
<span className="font-medium text-muted-foreground">{col.label}</span>
<span>{row[col.key]}</span>
</div>
))}
</div>
))}
</div>
</>
)
}Viewport Units
/* Standard viewport units - problematic on mobile */
.full-height { height: 100vh; }
/* Dynamic viewport units (recommended) */
.full-height-dynamic { height: 100dvh; } /* Accounts for mobile browser UI */
/* Small viewport (minimum when UI shown) */
.min-full-height { min-height: 100svh; }
/* Large viewport (maximum when UI hidden) */
.max-full-height { max-height: 100lvh; }Best Practices
- Mobile-First: Write base styles for mobile, enhance for larger screens
- Content Breakpoints: Set breakpoints where content breaks, not device sizes
- Fluid Over Fixed: Prefer
clamp()and relative units over fixedpx - Container Queries: Use for component-level responsiveness
- Touch Targets: Minimum 44×44px tap targets on mobile
- Test Real Devices: Simulators don't catch all issues
- Logical Properties: Use
inline/blockfor internationalization
Common Issues
| Issue | Cause | Fix |
| Horizontal scroll | Fixed widths | Use relative units, max-width: 100% |
| 100vh too tall on mobile | Address bar | Use 100dvh or 100svh |
| Tiny tap targets | Desktop design | Min 44px height/width on interactive elements |
| Images breaking layout | Missing constraints | Add max-width: 100%; height: auto; |
| Text too small | Fixed font size | Use fluid typography with clamp() |
NEVER
- Use
pxfor typography (userem) - Skip mobile testing on real devices
- Forget touch target sizing (44×44px minimum)
- Use
100vhon mobile without fallback - Nest too many media queries (flattens readability)
- Ignore content-based breakpoints in favor of device-specific ones
Other versions31 projects use a version of this.
Word for word · 0
None found.
Edited · 11
- MiladJoodi/skills★ 2420% same
- wpank/ai★ 11100% same
- ai4brands-design/claude-skills★ 225% same
- Aver005/agent-skills★ 248% same
- CodeWithBehnam/cc-docs★ 249% same
- JustineDevs/premortem★ 211% same
- roshankodi/agent-skills★ 211% same
- itsyasirkhandev/spec-driven-development★ 149% same
- davidanthonyn/claude-skills★ 011% same
- enes9103/my-claude-agents-skills★ 011% same
1 more not listed
Wrote their own version · 20
- epam/ai-dial-chat★ 505same name
- Mindrally/skills★ 275same name
- sunflowermm/XRK-AGT★ 140same name
- nahid-sparktales/agent-dispatcher★ 59same name
- launchapp-dev/animus-cli★ 39same name
- DigitalExplorers/agent-skills★ 12same name
- lotfb86/web-design-skills★ 9same name
- itsyasirkhandev/skills★ 4same name
- HamzaSheikh768/Agents-Skills-Lap★ 3same name
- MichaelZelbel/menerio★ 2same name
10 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use web-component-design, accessibility-compliance and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Aver005Skillweb-component-design
Master React, Vue, and Svelte component patterns including CSS-in-JS, composition strategies, and reusable component architecture. Use when building UI component libraries, designing component APIs, or implementing frontend design systems.
Also in 3 projects that use this
CodeWithBehnamSkillaccessibility-compliance
Implement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support. Use when auditing accessibility, implementing ARIA patterns, building for screen readers, or ensuring inclusive user experiences.
Also in 3 projects that use this
CodeWithBehnamSkillvisual-design-foundations
Apply typography, color theory, spacing systems, and iconography principles to create cohesive visual designs. Use when establishing design tokens, building style guides, or improving visual hierarchy and consistency.
Also in 3 projects that use this
wpankSkilldesign-system-patterns
Foundational design system architecture — token hierarchies, theming infrastructure, token pipelines, and governance. Use when creating design tokens, implementing theme switching, setting up Style Dictionary, or establishing multi-brand theming. Triggers on design tokens, theme provider, Style Dictionary, token pipeline, multi-brand theming, CSS custom properties architecture.
Also in 3 projects that use this
rastianSkillinteraction-design
Apply interaction design (IxD) principles and frameworks to product and service design work. Use this skill when designing or evaluating interaction flows, micro-interactions, feedback mechanisms, affordances, mental models, component states, response time, animation and transitions, error recovery, input validation, task flows, or navigation patterns. Core audiences: product designers, UX designers, UI designers, service designers, and interaction designers working on digital products and services. Trigger on: interaction flow, micro-interaction, affordance, feedback design, state design (hover/focus/error/loading/empty), response time, transition, animation, mental model, task flow, user flow, navigation design, interaction spec, handoff annotation, gesture, input validation, error state, loading state, empty state, system feedback, signifier, design review, interaction audit, IxD principles.
Also in 3 projects that use this
xfstudioSkillcode-review-excellence
Master effective code review practices to provide constructive feedback, catch bugs early, and foster knowledge sharing while maintaining team morale. Use when reviewing pull requests, establishing review standards, or mentoring developers.
Also in 3 projects that use this
In this repository60 other files it gives its agents.
- accessibility-auditSkill
- agent-browser-coreSkill
- ai-explainer-videoSkill
- ai-short-video-makerSkill
- ai-video-shortSkill
- AI 工具箱Skill
- antislopSkill
- browser-useSkill
- cangjie-skillSkill
- delivery-no-pseudoblockSkill
- design-reviewSkill
- design-routerSkill
- edge-tts-readSkill
- frontend-designSkill
- frontend-devSkill
- fuheshun-auto-clipSkill
- fullstack-devSkill
- githubSkill
- git-shipSkill
- grillingSkill
- hfut-inspectorSkill
- humanizerSkill
- image-to-editable-pptxSkill
- kdocsSkill
- local-video-pipelineSkill
- markitdown-skillSkill
- pdfSkill
- pptxSkill
- qf-english-polishSkill
- qq-emailSkill
- self-improving-agentSkill
- sherpa-onnx-ttsSkill
- short-video-script-to-finished-videoSkill
- skill-creatorSkill
- skill-integratorSkill
- tastemakerSkill
- techdebtSkill
- Typography FoundationsSkill
- ui-designSkill
- video-scriptSkill
- web-accessSkill
- web-design-guidelinesSkill
- web-design-layoutSkill
- wechat-article-proSkill
- wechat-article-searchSkill
- weekly-reviewSkill
- word-toolkitSkill
- WorkBuddy 工作原则Skill
- xlsxSkill
- yuketang-harvesterSkill
- 学术研究工具箱Skill
- 安全审查工具箱Skill
- 工程方法论工具箱Skill
- 开发工具箱Skill
- 微信小程序开发套件Skill
- 技能包跨机器打包Skill
- 文档工具箱Skill
- 知识工具箱Skill
- 联网工具箱Skill
- 评审委员会Skill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

