cosmicstack-labs/responsive-design
Responsive web design patterns, mobile-first CSS, container queries, fluid typography, and accessibility-first layouts
npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill responsive-design
Modern responsive design patterns using mobile-first methodology, CSS Grid, Flexbox, and container queries.
/* 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;
}
}
/* 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 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);
}
min-width not max-width. Use container queries for reusable components.min-height, max-width, and intrinsic sizing.Take cosmicstack-labs/responsive-design from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
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.