- Home
- Skills
- Frontend & Web Apps
- Responsive & Fluid Layout — Container Queries, clamp()
Works with the AI Agents you already use
Responsive & Fluid Layout — Container Queries, clamp()
Build modern, fluid web layouts using container queries, intrinsic grids, and clamp-based typography.
Free
Responsive & Fluid Layout — Container Queries, clamp()
Example session with this skill installed
Create a responsive 3-column pricing section that works on mobile and uses a fluid typography scale.
- Read your context and instructions
- Compiled the responsive & fluid
I have generated a responsive pricing section using fluid typography and an intrinsic grid layout. This implementation uses clamp() for scaling and container-type for component-level responsiveness.
Fluid Pricing Section
:root {
/* Fluid Scale: 1rem at 360px -> 1.13rem at 1440px */
--step-0: clamp(1rem, .96rem + .19vw, 1.13rem);
--step-2: clamp(1.44rem, 1.30rem + .65vw, 2rem);
--space-m: clamp(1.5rem, 1.39rem + .56vw, 2rem);
--space-l: clamp(2.5rem, 2.17rem + 1.67vw, 4rem);
}
.pricing-container {
width: min(100% - 2rem, 80rem);
margin-inline: auto;
padding-block: var(--space-l);
container-type: inline-size;
}
.pricing-grid {
display: grid;
gap: var(--space-m);
/* Intrinsic layout: wraps automatically at ~20rem */
grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
}
.card {
padding: var(--space-m);
border: 1px solid #ddd;
display: flex;
flex-direction: column;
gap: var(--step-0);
}
.card h2 {
font-size: var(--step-2);
margin: 0;
}
/* Specific layout shift for wide cards using container queries */
@container (min-width: 40rem) {
.card--featured {
grid-column: span 2;
display: grid;
grid-template-columns: 1fr 1fr;
align-items: center;
}
}
<section class="pricing-container">
<div class="pricing-grid">
<div class="card">
<h2>Starter</h2>
<p>Basic features for small teams.</p>
<button>Get Started</button>
</div>
<div class="card card--featured">
<div>
<h2>Pro</h2>
<p>Advanced tools for growing businesses.</p>
</div>
<button>Upgrade Now</button>
</div>
<div class="card">
<h2>Enterprise</h2>
<p>Custom solutions for large scale.</p>
<button>Contact Sales</button>
</div>
</div>
</section>
Next steps
- Add
viewport-fit=coverto your meta tag to handle mobile notches. - Review the
auto-fitminimum width to match your specific content needs. - Test the layout at 200% zoom to ensure text does not overflow containers.
Connects securely to your tools. The creator never sees your data.
About this skill
Maintaining separate codebases for mobile and desktop is a maintenance debt trap. This skill builds layouts that adapt to their containers using modern CSS, reducing the need for fragile media queries and device-specific breakpoints.
What it does
- Fluid scaling implements type and spacing scales using
clamp()formulas that interpolate between 360px and 1440px. - Intrinsic grids creates layouts using
auto-fitandminmaxthat reflow naturally without manual breakpoint triggers. - Container queries builds components that change layout based on their parent width rather than the browser viewport.
- Logical properties applies
inlineandblockspacing to ensure layouts support right-to-left (RTL) languages automatically. - Safe area handling manages mobile-specific constraints like the notch and dynamic viewport units to prevent layout jumps.
How it works
- Mobile-first start defines the core layout at a 320px single-column width to ensure no horizontal overflow.
- Token injection generates a fluid scale of CSS variables for typography and spacing.
- Component definition applies container-type properties to wrappers for localized responsiveness.
- Final audit verifies the layout against 200% browser zoom and various viewport heights (svh).
Frameworks & tools
Modern CSS (Level 4+), Tailwind CSS v4, HTML5, and browser-native Web APIs. Works with any frontend framework including React, Vue, Svelte, or vanilla HTML.
Why this beats prompting it yourself
Standard prompts often default to deprecated 100vh units that break on mobile browsers or excessive media queries that are hard to maintain. This skill enforces accessibility standards like WCAG 1.4.4 and uses container queries to make components truly portable across different page regions.
Use cases
- Responsive dashboards where widgets need to reflow when sidebars are toggled.
- Fluid marketing sites that require consistent typography scales across all screen sizes.
- Mobile web apps that must handle notch safe areas and dynamic URL bar resizing.
- Multilingual sites requiring automatic layout flipping for RTL support.
Known limitations
Requires modern browser support for container queries and logical properties. It does not provide fallbacks for legacy browsers like IE11.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.
Requires browsers supporting CSS container queries and clamp(). Does not include legacy polyfills or IE11 fallbacks.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 1 day ago
- Free with an Agensi account
Permissions
No special permissions declared or detected