mcpbeat

Responsive Design

cosmicstack-labs/responsive-design

Responsive web design patterns, mobile-first CSS, container queries, fluid typography, and accessibility-first layouts

512 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
365
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill responsive-design

The instruction itself

5 sections, as written by the author

Responsive Design

Modern responsive design patterns using mobile-first methodology, CSS Grid, Flexbox, and container queries.

Mobile-First Approach

/* Base styles = Mobile */
.container {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Tablet */
@media (min-width: 768px) {
  .container {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 2rem;
  }
}

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

Container Queries

/* Instead of viewport queries, query the container */
.card-container {
  container-type: inline-size;
  container-name: card;
}

@container card (min-width: 400px) {
  .card {
    display: grid;
    grid-template-columns: 200px 1fr;
  }
}

@container card (max-width: 399px) {
  .card {
    display: flex;
    flex-direction: column;
  }
}

Fluid Typography

/* Fluid type scale using clamp() */
:root {
  --text-sm: clamp(0.875rem, 0.8rem + 0.25vw, 1rem);
  --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  --text-lg: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  --text-xl: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

Common Mistakes

  • Starting with desktop: Always design mobile-first. It's easier to add than remove.
  • Relying only on media queries: Use min-width not max-width. Use container queries for reusable components.
  • Ignoring touch targets: Minimum 44x44px tap targets. No hover-dependent interactions on mobile.
  • Fixed widths and heights: Use min-height, max-width, and intrinsic sizing.
  • Not testing on real devices: Emulators aren't enough. Test on actual phones and tablets.

How to use it

Copy the folder

Take cosmicstack-labs/responsive-design from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.