agentleFS
MindrallyMindrally/skills/responsive-design/SKILL.md

responsive-design

Skill275 starsChanged 52 days agoApache-2.0View on GitHub

Comprehensive guidelines for responsive web design including mobile-first approach, flexible layouts, media queries, and cross-device optimization

35 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use visual-hierarchy, web-component-design and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • launchapp-devSkill

    visual-hierarchy

    Establish clear visual hierarchy through size, weight, color, spacing, and positioning.

    Also in 3 projects that use this

  • Aver005Skill

    web-component-design

    Master React, Vue, and Svelte component patterns including CSS-in-JS, composition strategies, and reusable component architecture. Use when building UI component libraries, designing component APIs, or implementing frontend design systems.

    Also in 3 projects that use this

  • CodeWithBehnamSkill

    accessibility-compliance

    Implement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support. Use when auditing accessibility, implementing ARIA patterns, building for screen readers, or ensuring inclusive user experiences.

    Also in 3 projects that use this

  • CodeWithBehnamSkill

    visual-design-foundations

    Apply typography, color theory, spacing systems, and iconography principles to create cohesive visual designs. Use when establishing design tokens, building style guides, or improving visual hierarchy and consistency.

    Also in 3 projects that use this

  • wpankSkill

    design-system-patterns

    Foundational design system architecture — token hierarchies, theming infrastructure, token pipelines, and governance. Use when creating design tokens, implementing theme switching, setting up Style Dictionary, or establishing multi-brand theming. Triggers on design tokens, theme provider, Style Dictionary, token pipeline, multi-brand theming, CSS custom properties architecture.

    Also in 3 projects that use this

  • ManramSkill

    interaction-design

    Design and implement microinteractions, motion design, transitions, and user feedback patterns. Use when adding polish to UI interactions, implementing loading states, or creating delightful user experiences.

    Also in 4 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

39 rules. 0 are common, 26 are distinctive, and 13 are very specific to this project.

  • 0

    Common

    Most of the 32 edited versions we read keep these.

  • 26

    Distinctive

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write semantic HTML to improve accessibility and SEO

    line 13
  2. Distinctive:

    Use CSS for styling, avoiding inline styles

    line 14
  3. Distinctive:

    Ensure responsive design using media queries and flexible layouts

    line 15
  4. Distinctive:

    Start with styles for the smallest viewport

    line 22
  5. Distinctive:

    Add complexity through progressive enhancement

    line 23
  6. Distinctive:

    Use for one-dimensional layouts (row or column)

    line 58
  7. Very specific:

    Use gap for consistent spacing

    line 60
  8. Distinctive:

    Use for two-dimensional layouts

    line 64
  9. Very specific:

    Use minmax() for flexible track sizing

    line 66
  10. Distinctive:

    Use for truly reusable components

    line 79
  11. Very specific:

    Use clamp() for responsive font sizes

    line 85
  12. Distinctive:

    Avoid text that's too small on mobile or too large on desktop

    line 87
  13. Very specific:

    Use rem for scalable typography

    line 96
  14. Very specific:

    Use em for component-relative sizing

    line 98
  15. Very specific:

    Avoid fixed px values for font sizes

    line 99
  16. Very specific:

    Use srcset for multiple image resolutions

    line 104
  17. Very specific:

    Use sizes to indicate display size at breakpoints

    line 105
  18. Distinctive:

    Use for art direction (different crops at different sizes)

    line 118
  19. Distinctive:

    Use media attributes for breakpoint-specific sources

    line 120
  20. Very specific:

    Use loading="lazy" for below-fold images

    line 124
  21. Very specific:

    Consider aspect-ratio CSS property

    line 125
  22. Very specific:

    Use @supports for feature detection

    line 151
  23. Distinctive:

    Test for specific CSS properties

    line 153
  24. Distinctive:

    Consider thumb reach zones on mobile

    line 165
  25. Distinctive:

    Don't rely solely on hover states

    line 168
  26. Very specific:

    Use @media (hover: hover) for hover-capable devices

    line 170
  27. Distinctive:

    Always include viewport meta tag

    line 180
  28. Very specific:

    Don't disable user scaling (avoid user-scalable=no)

    line 181
  29. Distinctive:

    Test with pinch-to-zoom enabled

    line 182
  30. Distinctive:

    Ensure content is usable at 200% zoom

    line 183
  31. Distinctive:

    Test at multiple viewport sizes

    line 194
  32. Distinctive:

    Test landscape and portrait orientations

    line 195
  33. Distinctive:

    Test with touch and mouse input

    line 196
  34. Distinctive:

    Test with keyboard navigation

    line 197
  35. Distinctive:

    Verify images load appropriate sizes

    line 198
  36. Distinctive:

    Verify touch targets are adequate

    line 200
  37. Distinctive:

    Test with browser zoom

    line 201
  38. Distinctive:

    Use modern formats (WebP, AVIF)

    line 212
  39. Distinctive:

    Consider responsive loading strategies

    line 214

“Common” is measured: kept by at least 6 in 10 of the 32 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Responsive Design Guidelines

Core Principles

  • Write semantic HTML to improve accessibility and SEO
  • Use CSS for styling, avoiding inline styles
  • Ensure responsive design using media queries and flexible layouts
  • Prioritize accessibility by using ARIA roles and attributes
  • Design mobile-first, then enhance for larger screens

Mobile-First Approach

Strategy

  • Start with styles for the smallest viewport
  • Add complexity through progressive enhancement
  • Base styles work without media queries
  • Media queries add features for larger screens

Benefits

  • Forces prioritization of essential content
  • Improves performance on mobile devices
  • Ensures core functionality works everywhere
  • Reduces CSS complexity and specificity issues
/* Base styles for mobile */
.container {
  padding: 1rem;
}

/* Tablet and up */
@media (min-width: 768px) {
  .container {
    padding: 2rem;
  }
}

/* Desktop and up */
@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
    margin: 0 auto;
  }
}

Flexible Layouts

Flexbox

  • Use for one-dimensional layouts (row or column)
  • Leverage flex-wrap for responsive wrapping
  • Use gap for consistent spacing
  • Combine with media queries for layout changes

CSS Grid

  • Use for two-dimensional layouts
  • Leverage auto-fit and auto-fill for responsive grids
  • Use minmax() for flexible track sizing
  • Combine fr units with fixed minimums
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

Container Queries

  • Style components based on container size, not viewport
  • Use for truly reusable components
  • Define containers with container-type

Responsive Typography

Fluid Typography

  • Use clamp() for responsive font sizes
  • Set minimum, preferred, and maximum values
  • Avoid text that's too small on mobile or too large on desktop
h1 {
  font-size: clamp(1.5rem, 4vw + 1rem, 3rem);
}

Units

  • Use rem for scalable typography
  • Base rem on user's browser settings
  • Use em for component-relative sizing
  • Avoid fixed px values for font sizes

Responsive Images

Srcset and Sizes

  • Use srcset for multiple image resolutions
  • Use sizes to indicate display size at breakpoints
  • Let browser choose optimal image
<img
  src="image-800.jpg"
  srcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w"
  sizes="(max-width: 600px) 100vw, (max-width: 1000px) 50vw, 800px"
  alt="Description"
>

Picture Element

  • Use for art direction (different crops at different sizes)
  • Provide fallback with <img> element
  • Use media attributes for breakpoint-specific sources

Performance

  • Include width and height attributes to prevent layout shift
  • Use loading="lazy" for below-fold images
  • Consider aspect-ratio CSS property

Media Queries

Common Breakpoints

/* Small phones */
@media (min-width: 320px) { }

/* Large phones */
@media (min-width: 480px) { }

/* Tablets */
@media (min-width: 768px) { }

/* Laptops/Desktops */
@media (min-width: 1024px) { }

/* Large screens */
@media (min-width: 1280px) { }

/* Extra large screens */
@media (min-width: 1536px) { }

Feature Queries

  • Use @supports for feature detection
  • Provide fallbacks for unsupported features
  • Test for specific CSS properties

Preference Queries

  • prefers-color-scheme for dark/light mode
  • prefers-reduced-motion for animation preferences
  • prefers-contrast for contrast preferences

Touch Targets

Sizing

  • Minimum 44x44 pixels for touch targets
  • Provide adequate spacing between targets
  • Consider thumb reach zones on mobile

Interaction

  • Don't rely solely on hover states
  • Provide touch alternatives for hover interactions
  • Use @media (hover: hover) for hover-capable devices

Viewport Configuration

Meta Tag

<meta name="viewport" content="width=device-width, initial-scale=1">

Best Practices

  • Always include viewport meta tag
  • Don't disable user scaling (avoid user-scalable=no)
  • Test with pinch-to-zoom enabled
  • Ensure content is usable at 200% zoom

Testing

Tools

  • Browser DevTools device emulation
  • Real device testing when possible
  • Lighthouse for performance audits
  • W3C validators for code quality

Checklist

  • Test at multiple viewport sizes
  • Test landscape and portrait orientations
  • Test with touch and mouse input
  • Test with keyboard navigation
  • Verify images load appropriate sizes
  • Check typography readability
  • Verify touch targets are adequate
  • Test with browser zoom

Performance Considerations

Critical CSS

  • Inline critical above-fold CSS
  • Defer non-critical stylesheets
  • Minimize render-blocking resources

Asset Optimization

  • Compress images appropriately
  • Use modern formats (WebP, AVIF)
  • Lazy load below-fold content
  • Consider responsive loading strategies

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.