PluginBench
Skill
Review
Audit score 70

responsive-patterns

yonatangross/orchestkit

Container queries, fluid typography, and mobile-first patterns for responsive React layouts.

What is responsive-patterns?

Modern responsive design patterns using Container Queries, fluid typography with clamp(), and mobile-first strategies for React applications. Use when building responsive layouts, component-level adaptation, or designing for multiple container sizes without media query overload.

  • Build reusable components that adapt to their container size using @container queries
  • Implement fluid typography that scales smoothly with clamp() while respecting user font preferences
  • Create responsive layouts with intrinsic CSS Grid patterns (auto-fit/minmax) and zero media queries
  • Design for foldable and dual-screen devices with safe-area insets and viewport segment queries
  • Use Container Query Units (cqi/cqb) for logical, i18n-ready responsive sizing
  • Optimize responsive images with srcset, sizes, and picture elements

How to install responsive-patterns

npx skills add https://github.com/yonatangross/orchestkit --skill responsive-patterns
Prerequisites
  • React application (Claude Code 2.1.277+)
  • Modern browser support: Chrome 105+, Safari 16+, Firefox 110+, Edge 105+
Claude Code
Cursor
Windsurf
Cline

How to use responsive-patterns

  1. 1.Load the relevant rule file for your use case: css-subgrid.md, css-intrinsic-responsive.md, css-patterns.md, or react-patterns.md
  2. 2.For container queries: set container-type on parent, use @container queries on children with cqi/cqb units
  3. 3.For fluid typography: use clamp(min-rem, preferred-vw, max-rem) to scale text while respecting user preferences
  4. 4.For responsive grids: use auto-fit with minmax() for intrinsic layouts without media queries
  5. 5.For foldable devices: apply env(safe-area-inset-*) and viewport segment queries for dual-screen support

Use cases

Good for
  • Building a card component that responds to its container width rather than viewport size
  • Creating fluid typography that scales between min and max sizes without breakpoints
  • Designing a responsive grid layout that adapts to sidebar presence or modal contexts
  • Supporting foldable devices with safe-area insets and dual-screen layouts
  • Implementing mobile-first CSS that progressively enhances for larger screens
Who it's for
  • Frontend UI developers building React applications
  • Design system maintainers creating reusable responsive components
  • Teams adopting modern CSS layout techniques (2023+ browser baseline)
  • Developers optimizing for mobile-first and progressive enhancement

responsive-patterns FAQ

When should I use container queries vs media queries?

Use container queries for component-level responsive design (cards, sidebars, modals) so components are truly portable. Use media queries for page-level layout decisions. Container queries have baseline support in Chrome 105+, Safari 16+, Firefox 110+, Edge 105+.

Why use cqi/cqb instead of cqw/cqh?

cqi (container inline) and cqb (container block) are logical units that respect text direction (LTR/RTL), making them i18n-ready. cqw/cqh are physical units and don't adapt to language direction.

How do I make fluid typography accessible?

Always include rem in your clamp() formula: font-size: clamp(1rem, 0.5rem + 2vw, 2rem). This ensures user font preferences and zoom settings are respected. Never use viewport units alone (e.g., 5vw).

What's the difference between auto-fit and auto-fill in CSS Grid?

auto-fit collapses empty tracks, making remaining items expand to fill space. auto-fill keeps empty tracks, useful for icon grids. Use auto-fit for card layouts where you want items to grow.

How do I support foldable devices?

Use env(safe-area-inset-*) CSS variables to avoid content in notches/hinges, and implement viewport segment queries to detect dual-screen layouts and position content accordingly.

Full instructions (SKILL.md)

Source of truth, from yonatangross/orchestkit.


name: responsive-patterns license: MIT compatibility: "Claude Code 2.1.277+." description: Responsive design with Container Queries, fluid typography, cqi/cqb units, subgrid, intrinsic layouts, foldable devices, and mobile-first patterns for React applications. Use when building responsive layouts or container queries. context: fork agent: frontend-ui-developer user-invocable: false disable-model-invocation: true metadata: category: document-asset-creation version: "1.1.0" author: "OrchestKit" complexity: "medium" tags: "responsive, container-queries, fluid-typography, mobile-first, css-grid, clamp, cqi, breakpoints, pwa, service-worker, workbox, offline-first, animation, motion, framer-motion, scroll-driven, view-transitions, subgrid, intrinsic-layout, foldable, dual-screen, safe-area" allowed-tools:

  • Read
  • Glob
  • Grep
  • WebFetch
  • WebSearch

Responsive Patterns

Modern responsive design patterns using Container Queries, fluid typography, and mobile-first strategies for React applications (2026 best practices).

Overview

  • Building reusable components that adapt to their container
  • Implementing fluid typography that scales smoothly
  • Creating responsive layouts without media query overload
  • Building design system components for multiple contexts
  • Optimizing for variable container sizes (sidebars, modals, grids)

Core Concepts

Container Queries vs Media Queries

FeatureMedia QueriesContainer Queries
Responds toViewport sizeContainer size
Component reuseContext-dependentTruly portable
Browser supportUniversalBaseline 2023+
Use casePage layoutsComponent layouts

Modern CSS Layout

Load Read("rules/css-subgrid.md") for CSS Subgrid patterns: nested grid alignment, card layouts with aligned titles/content/actions, two-dimensional subgrid.

Load Read("rules/css-intrinsic-responsive.md") for intrinsically responsive layouts: auto-fit/minmax grids, clamp() for fluid everything, container queries for component logic, zero media query patterns.

Load Read("rules/responsive-foldables.md") for foldable/multi-screen device support: env(safe-area-inset-*), viewport segment queries, dual-screen layouts, progressive enhancement.

Key patterns covered: CSS Subgrid alignment, intrinsic responsive grids (auto-fit + minmax), fluid clamp() scales, foldable device layouts, safe area insets, viewport segment queries.

CSS Patterns

Load Read("rules/css-patterns.md") for complete CSS examples: container queries, cqi/cqb units, fluid typography with clamp(), mobile-first breakpoints, CSS Grid patterns, and scroll-queries.

Key patterns covered: Container Query basics, Container Query Units (cqi/cqb), Fluid Typography with clamp(), Container-Based Fluid Typography, Mobile-First Breakpoints, CSS Grid Responsive Patterns, Container Scroll-Queries (Chrome 126+).

React Patterns

Load Read("rules/react-patterns.md") for complete React examples: ResponsiveCard component, Tailwind container queries, useContainerQuery hook, and responsive images.

Key patterns covered: Responsive Component with Container Queries, Tailwind CSS Container Queries, useContainerQuery Hook, Responsive Images Pattern.

Accessibility Considerations

/* IMPORTANT: Always include rem in fluid typography */
/* This ensures user font preferences are respected */

/* ❌ WRONG: Viewport-only ignores user preferences */
font-size: 5vw;

/* ✅ CORRECT: Include rem to respect user settings */
font-size: clamp(1rem, 0.5rem + 2vw, 2rem);

/* User zooming must still work */
@media (min-width: 768px) {
  /* Use em/rem, not px, for breakpoints in ideal world */
  /* (browsers still use px, but consider user zoom) */
}

Anti-Patterns (FORBIDDEN)

/* ❌ NEVER: Use only viewport units for text */
.title {
  font-size: 5vw; /* Ignores user font preferences! */
}

/* ❌ NEVER: Use cqw/cqh (use cqi/cqb instead) */
.card {
  padding: 5cqw; /* cqw = container width, not logical */
}
/* ✅ CORRECT: Use logical units */
.card {
  padding: 5cqi; /* Container inline = logical direction */
}

/* ❌ NEVER: Container queries without container-type */
@container (min-width: 400px) {
  /* Won't work without container-type on parent! */
}

/* ❌ NEVER: Desktop-first media queries */
.element {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 768px) {
  .element {
    grid-template-columns: 1fr; /* Overriding = more CSS */
  }
}

/* ❌ NEVER: Fixed pixel breakpoints for text */
@media (min-width: 768px) {
  body { font-size: 18px; } /* Use rem! */
}

/* ❌ NEVER: Over-nesting container queries */
@container a {
  @container b {
    @container c {
      /* Too complex, reconsider architecture */
    }
  }
}

Browser Support

FeatureChromeSafariFirefoxEdge
Container Size Queries105+16+110+105+
Container Style Queries111+❌❌111+
Container Scroll-State126+❌❌126+
cqi/cqb units105+16+110+105+
clamp()79+13.1+75+79+
Subgrid117+16+71+117+

Rules

Each category has individual rule files in rules/ loaded on-demand:

CategoryRuleImpactKey Pattern
Modern CSS Layoutrules/css-subgrid.mdHIGHCSS Subgrid for nested grid alignment, card layouts
Modern CSS Layoutrules/css-intrinsic-responsive.mdHIGHIntrinsic responsive layouts, auto-fit/minmax, clamp(), zero breakpoints
Modern CSS Layoutrules/responsive-foldables.mdMEDIUMFoldable devices, safe area insets, viewport segments
CSSrules/css-patterns.mdHIGHContainer queries, cqi/cqb, fluid typography, grid, scroll-queries
Reactrules/react-patterns.mdHIGHContainer query components, Tailwind, useContainerQuery, responsive images
PWArules/pwa-service-worker.mdHIGHWorkbox caching strategies, VitePWA, update management
PWArules/pwa-offline.mdHIGHOffline hooks, background sync, install prompts
Animationrules/animation-motion.mdHIGHMotion presets, AnimatePresence, View Transitions
Animationrules/animation-scroll.mdMEDIUMCSS scroll-driven animations, parallax, progressive enhancement
Touch & Mobilerules/touch-interaction.mdHIGHTouch targets (44px min), thumb zones, pinch-to-zoom, safe areas, gestures

Total: 10 rules across 6 categories

Key Decisions

DecisionOption AOption BRecommendation
Query typeMedia queriesContainer queriesContainer for components, Media for layout
Container unitscqw/cqhcqi/cqbcqi/cqb (logical, i18n-ready)
Fluid type basevw onlyrem + vwrem + vw (accessibility)
Mobile-firstYesDesktop-firstMobile-first (less CSS, progressive)
Grid patternauto-fitauto-fillauto-fit for cards, auto-fill for icons

Related Skills

  • design-system-starter - Building responsive design systems
  • ork:performance - CLS, responsive images, and image optimization
  • ork:i18n-date-patterns - RTL/LTR responsive considerations

Capability Details

container-queries

Keywords: @container, container-type, inline-size, container-name Solves: Component-level responsive design

fluid-typography

Keywords: clamp(), fluid, vw, rem, scale, typography Solves: Smooth font scaling without breakpoints

responsive-images

Keywords: srcset, sizes, picture, art direction Solves: Responsive images for different viewports

mobile-first-strategy

Keywords: min-width, mobile, progressive, breakpoints Solves: Efficient responsive CSS architecture

grid-flexbox-patterns

Keywords: auto-fit, auto-fill, subgrid, minmax Solves: Responsive grid and flexbox layouts

container-units

Keywords: cqi, cqb, container width, container height Solves: Sizing relative to container dimensions

References

Load on demand with Read("references/<file>"):

FileContent
container-queries.mdContainer query patterns
fluid-typography.mdAccessible fluid type scales