
Responsive Design
Install this skill when your agent needs mobile-first breakpoints, fluid layouts, and framework-aligned media queries for shipping responsive UI.
Install
npx skills add https://github.com/wshobson/agents --skill responsive-designWhat is this skill?
- Mobile-first progressive enhancement pattern with min-width media queries
- Content-driven breakpoints instead of chasing arbitrary device sizes
- Tailwind default scale documented (sm 640px through 2xl 1536px)
- Bootstrap 5 breakpoint reference for cross-framework parity
- Fluid sizing techniques paired with fewer, intentional breakpoints
Adoption & trust: 12.2k installs on skills.sh; 36.5k GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Journey fit
Responsive layout decisions belong on the Build shelf because they happen while implementing UI, not during initial market research. Frontend is the canonical subphase for CSS breakpoint strategy, container queries, and progressive enhancement in components and pages.
Common Questions / FAQ
Is Responsive Design safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Responsive Design
# Breakpoint Strategies ## Overview Effective breakpoint strategies focus on content needs rather than device sizes. Modern responsive design uses fewer, content-driven breakpoints combined with fluid techniques. ## Mobile-First Approach ### Core Philosophy Start with the smallest screen, then progressively enhance for larger screens. ```css /* Base styles (mobile first) */ .component { display: flex; flex-direction: column; padding: 1rem; } /* Enhance for larger screens */ @media (min-width: 640px) { .component { flex-direction: row; padding: 1.5rem; } } @media (min-width: 1024px) { .component { padding: 2rem; } } ``` ### Benefits 1. **Performance**: Mobile devices load only necessary CSS 2. **Progressive Enhancement**: Features add rather than subtract 3. **Content Priority**: Forces focus on essential content first 4. **Simplicity**: Easier to reason about cascading styles ## Common Breakpoint Scales ### Tailwind CSS Default ```css /* Tailwind breakpoints */ /* sm: 640px - Landscape phones */ /* md: 768px - Tablets */ /* lg: 1024px - Laptops */ /* xl: 1280px - Desktops */ /* 2xl: 1536px - Large desktops */ @media (min-width: 640px) { /* sm */ } @media (min-width: 768px) { /* md */ } @media (min-width: 1024px) { /* lg */ } @media (min-width: 1280px) { /* xl */ } @media (min-width: 1536px) { /* 2xl */ } ``` ### Bootstrap 5 ```css /* Bootstrap breakpoints */ /* sm: 576px */ /* md: 768px */ /* lg: 992px */ /* xl: 1200px */ /* xxl: 1400px */ @media (min-width: 576px) { /* sm */ } @media (min-width: 768px) { /* md */ } @media (min-width: 992px) { /* lg */ } @media (min-width: 1200px) { /* xl */ } @media (min-width: 1400px) { /* xxl */ } ``` ### Minimalist Scale ```css /* Simplified 3-breakpoint system */ /* Base: Mobile (< 600px) */ /* Medium: Tablets and small laptops (600px - 1024px) */ /* Large: Desktops (> 1024px) */ :root { --bp-md: 600px; --bp-lg: 1024px; } @media (min-width: 600px) { /* Medium */ } @media (min-width: 1024px) { /* Large */ } ``` ## Content-Based Breakpoints ### Finding Natural Breakpoints Instead of using device-based breakpoints, identify where your content naturally needs to change. ```css /* Bad: Device-based thinking */ @media (min-width: 768px) { /* iPad breakpoint */ } /* Good: Content-based thinking */ /* Breakpoint where sidebar fits comfortably next to content */ @media (min-width: 50rem) { .layout { display: grid; grid-template-columns: 1fr 300px; } } /* Breakpoint where cards can show 3 across without crowding */ @media (min-width: 65rem) { .card-grid { grid-template-columns: repeat(3, 1fr); } } ``` ### Testing Content Breakpoints ```javascript // Find where content breaks function findBreakpoints(selector) { const element = document.querySelector(selector); const breakpoints = []; for (let width = 320; width <= 1920; width += 10) { element.style.width = `${width}px`; // Check for overflow, wrapping, or layout issues if (element.scrollWidth > element.clientWidth) { breakpoints.push({ width, issue: "overflow" }); } } return breakpoints; } ``` ## Design Token Integration ### Breakpoint Tokens ```css :root { /* Breakpoint values */ --breakpoint-sm: 640px; --breakpoint-md: 768px; --breakpoint-lg: 1024px; --breakpoint-xl: 1280px; --breakpoint-2xl: 1536px; /* Container widths for each breakpoint */ --container-sm: 640px; --container-md: 768px; --container-lg: 1024px; --container-xl: 1280px; --container-2xl: 1536px; } .container { width: 100%; max-width: var(--container-lg); margin-inline: auto; padding-inline: var(--space-4); } ``` ### JavaScript Integration ```typescript // Breakpoint constants export const breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280, "2xl": 1536, } as const; // Media query hook function useMediaQuery(query: string): boolean { const [matches, setMatches] = useState(false); useEffect