responsive-design
БесплатноБез исполняемых скриптовНе проверенMobile-first responsive design covering fluid layouts, media queries, flexbox, grid, viewport units, and responsive images
Об этом скилле
Responsive Design Skill
When to Use This Skill
Use this skill when you need to:
- Design and implement mobile-first responsive layouts
- Create fluid, adaptive interfaces that work across all device sizes
- Implement modern CSS layout techniques (Flexbox, Grid)
- Optimize images and media for different screen sizes
- Build accessible, touch-friendly interfaces
- Implement responsive typography and spacing systems
- Create container-based responsive components
- Optimize performance for mobile devices
- Ensure consistent user experience across devices
- Implement responsive navigation patterns
- Design responsive forms and data tables
- Create adaptive card layouts and galleries
- Build responsive dashboards and admin interfaces
Core Concepts
Mobile-First Philosophy
Mobile-first design means starting with mobile layout and progressively enhancing for larger screens.
Why Mobile-First?
- Forces focus on essential content and features
- Easier to scale up than scale down
- Better performance on mobile devices
- Aligns with modern usage patterns (mobile-first world)
- Simpler CSS with fewer overrides
Mobile-First Approach:
/* Base styles for mobile (320px+) */
.container {
padding: 1rem;
width: 100%;
}
/* Tablet (768px+) */
@media (min-width: 768px) {
.container {
padding: 2rem;
max-width: 720px;
margin: 0 auto;
}
}
/* Desktop (1024px+) */
@media (min-width: 1024px) {
.container {
max-width: 960px;
padding: 3rem;
}
}
/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
.container {
max-width: 1200px;
}
}
Breakpoint Strategy
Standard breakpoints based on common device sizes:
/* Extra Small (Mobile) - Default */
/* No media query needed */
/* Small (Large Mobile) */
@media (min-width: 480px) { }
/* Medium (Tablet) */
@media (min-width: 768px) { }
/* Large (Desktop) */
@media (min-width: 1024px) { }
/* Extra Large (Wide Desktop) */
@media (min-width: 1280px) { }
/* XXL (Ultra-wide) */
@media (min-width: 1536px) { }
Custom Breakpoints:
/* Use custom breakpoints based on content, not devices */
/* When text becomes too long to read comfortably */
@media (min-width: 40em) { /* 640px */ }
/* When sidebar can fit alongside content */
@media (min-width: 60em) { /* 960px */ }
/* When multi-column layout makes sense */
@media (min-width: 75em) { /* 1200px */ }
Fluid Layouts
Create layouts that adapt smoothly to any screen size:
/* Fluid container with constraints */
.container {
width: 100%;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
padding-left: clamp(1rem, 5vw, 3rem);
padding-right: clamp(1rem, 5vw, 3rem);
}
/* Fluid grid */
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: clamp(1rem, 3vw, 2rem);
}
/* Fluid typography */
.heading {
font-size: clamp(1.5rem, 4vw + 1rem, 3rem);
line-height: 1.2;
}
CSS Techniques
Flexbox for Responsive Layouts
Flexbox excels at one-dimensional layouts (row or column):
/* Responsive navigation */
.nav {
display: flex;
flex-wrap: wrap;
gap: 1rem;
justify-content: space-between;
align-items: center;
}
.nav-links {
display: flex;
flex-wrap: wrap;
gap: 1rem;
list-style: none;
}
@media (max-width: 767px) {
.nav {
flex-direction: column;
align-items: stretch;
}
.nav-links {
flex-direction: column;
}
}
/* Flexible card layout */
.card-container {
display: flex;
flex-wrap: wrap;
gap: 1.5rem;
}
.card {
flex: 1 1 300px; /* grow, shrink, base width */
min-width: 0; /* Allow flex items to shrink below content size */
}
/* Responsive sidebar layout */
.layout {
display: flex;
flex-wrap: wrap;
gap: 2rem;
}
.sidebar {
flex: 1 1 250px;
}
.main-content {
flex: 3 1 500px;
}
CSS Grid for Complex Layouts
Grid is perfect for two-dimensional layouts:
/* Auto-responsive grid */
.grid-auto {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 2rem;
}
/* Named grid areas for semantic layouts */
.page-layout {
display: grid;
grid-template-areas:
"header"
"nav"
"main"
"aside"
"footer";
gap: 1rem;
}
@media (min-width: 768px) {
.page-layout {
grid-template-areas:
"header header"
"nav nav"
"main aside"
"footer footer";
grid-template-columns: 2fr 1fr;
}
}
@media (min-width: 1024px) {
.page-layout {
grid-template-areas:
"header header header"
"nav main aside"
"footer footer footer";
grid-template-columns: 200px 1fr 250px;
}
}
.header { grid-area: header; }
.nav { grid-area: nav; }
.main { grid-area: main; }
.aside { grid-area: aside; }
.footer { grid-area: footer; }
/* Responsive grid with precise control */
.gallery {
display: grid;
grid-template-columns: repeat(12, 1fr);
gap: 1rem;
}
.gallery-item {
grid-column: span 12; /* Full width on mobile */
}
@media
Установить responsive-design в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл responsive-design?
Mobile-first responsive design covering fluid layouts, media queries, flexbox, grid, viewport units, and responsive images
Как установить скилл responsive-design?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл responsive-design запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic