responsive-design

Implement responsive layouts using container queries, fluid typography, and CSS Grid.

Updated Sep 8, 2026
One-click install
npx skills add https://github.com/pedropenha/project-skills --skill responsive-design-pedropenha
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: responsive-design
Source: https://github.com/pedropenha/project-skills/tree/main/.agents/skills/responsive-design
Command: npx skills add https://github.com/pedropenha/project-skills --skill responsive-design-pedropenha

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building interfaces that adapt cleanly across screen sizes often leads to device-specific breakpoints, fixed pixel values, and components that break when reused in different contexts. This Skill provides modern CSS patterns for creating layouts that respond to content and container size rather than viewport alone. ## Core Features & Use Cases - Container Queries: Build component-level responsiveness with container-type, named containers, and container query units (cqi, cqw) so components adapt wherever they are placed. - Fluid Typography & Spacing: Generate clamp()-based type and spacing scales that scale smoothly between minimum and maximum bounds without media query jumps. - Layout Patterns: Apply CSS Grid auto-fit layouts, Flexbox sidebar and switcher patterns, responsive navigation, tables, and images with srcset and art direction. - Use Case: You are building a card component reused in a sidebar, a grid, and a full-width hero. Instead of viewport breakpoints, wrap it in a container query context so it switches from stacked to horizontal layout based on its own width. ## Quick Start Use the responsive-design skill to refactor my card component so it adapts to its container width using container queries and fluid typography.

Frequently Asked Questions about responsive-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use CSS container queries for responsive components?▼

Set container-type: inline-size on a wrapper element, then use @container (min-width: 400px) to style children based on the container's width. Named containers via container-name let you target specific contexts when multiple containers nest.

How to create fluid typography with CSS clamp()?▼

Use clamp(min, preferred, max) where the preferred value combines a rem base with a vw term, such as clamp(1rem, 0.9rem + 0.5vw, 1.125rem). This scales text smoothly between the minimum and maximum sizes without media queries.

Container queries vs media queries: which should I use?▼

Use container queries when a component's layout depends on where it is placed, such as cards reused in sidebars and grids. Use media queries for page-level layout changes tied to the overall viewport, like navigation patterns.

Does container query support work in all browsers?▼

Container queries work in Chrome 105+, Firefox 110+, and Safari 16+. For older browsers, wrap container query rules in @supports (container-type: inline-size) and provide media query or default flex-column fallbacks.

Why does 100vh cause layout issues on mobile browsers?▼

Mobile browsers show and hide UI chrome, changing the visible viewport height. Use dynamic viewport units like 100dvh, or 100svh for the minimum height, so full-height sections stay correct as browser UI appears and disappears.

How do I make responsive tables for mobile screens?▼

Wrap the table in a container with overflow-x: auto and a min-width for horizontal scrolling, or transform rows into stacked cards below a breakpoint using display: block on rows and data-label attributes for cell labels.