// Expert responsive design mentor focused on modern mobile UI patterns, touch-friendly interactions, and performance optimization. Reviews layouts for mobile-first best practices, identifies accessibility issues, validates touch targets, checks responsive breakpoints, and suggests PWA enhancements. Use when designing or reviewing mobile interfaces, responsive layouts, touch interactions, or when users mention mobile design, responsive web design, PWA, or accessibility.
| name | mobile-first-designer |
| description | Expert responsive design mentor focused on modern mobile UI patterns, touch-friendly interactions, and performance optimization. Reviews layouts for mobile-first best practices, identifies accessibility issues, validates touch targets, checks responsive breakpoints, and suggests PWA enhancements. Use when designing or reviewing mobile interfaces, responsive layouts, touch interactions, or when users mention mobile design, responsive web design, PWA, or accessibility. |
This skill provides expert guidance on creating mobile-first, responsive designs that prioritize usability, performance, and accessibility across all devices. It enforces industry standards for touch interactions, responsive layouts, and progressive web app capabilities.
Core Philosophy: Design for mobile constraints first, then progressively enhance for larger screens. This ensures optimal experiences on the devices most users rely on.
Minimum Size: 44x44 pixels (Apple HIG standard)
Spacing: Minimum 8px between interactive elements
Examples:
/* Good - Meets minimum touch target */
.button {
min-height: 44px;
min-width: 44px;
padding: 12px 24px;
}
/* Good - Adequate spacing */
.action-buttons {
display: flex;
gap: 8px; /* Minimum spacing */
}
/* Bad - Too small for touch */
.small-link {
font-size: 10px;
padding: 2px;
}
Write CSS for mobile devices first, then use min-width media queries to enhance for larger screens:
/* Base styles for mobile (320px+) */
body {
font-size: 16px; /* Never go below 16px to prevent zoom on iOS */
line-height: 1.5;
padding: 16px;
}
.container {
width: 100%;
max-width: 100%;
}
/* Tablet enhancement (768px+) */
@media (min-width: 768px) {
body {
font-size: 18px;
padding: 24px;
}
.container {
max-width: 720px;
margin: 0 auto;
}
}
/* Desktop enhancement (1024px+) */
@media (min-width: 1024px) {
body {
font-size: 20px;
}
.container {
max-width: 960px;
}
}
Mobile Requirements:
/* Mobile typography */
body {
font-size: 16px;
line-height: 1.5;
}
h1 { font-size: 32px; line-height: 1.2; }
h2 { font-size: 28px; line-height: 1.25; }
h3 { font-size: 24px; line-height: 1.3; }
.content {
max-width: 65ch; /* Optimal readability */
}
/* Scale up for larger screens */
@media (min-width: 768px) {
body { font-size: 18px; }
h1 { font-size: 40px; }
}
Use flexible, percentage-based layouts that adapt naturally:
/* Flexbox approach */
.grid {
display: flex;
flex-wrap: wrap;
gap: 16px;
}
.grid-item {
flex: 1 1 100%; /* Mobile: full width */
min-width: 0; /* Prevents overflow */
}
@media (min-width: 768px) {
.grid-item {
flex: 1 1 calc(50% - 8px); /* Tablet: 2 columns */
}
}
@media (min-width: 1024px) {
.grid-item {
flex: 1 1 calc(33.333% - 12px); /* Desktop: 3 columns */
}
}
Serve appropriately sized images for different devices:
<!-- Responsive image with srcset -->
<img
src="image-320w.jpg"
srcset="image-320w.jpg 320w,
image-640w.jpg 640w,
image-1280w.jpg 1280w"
sizes="(max-width: 480px) 100vw,
(max-width: 768px) 50vw,
25vw"
alt="Description"
>
<!-- Modern image formats -->
<picture>
<source srcset="image.webp" type="image/webp">
<source srcset="image.avif" type="image/avif">
<img src="image.jpg" alt="Fallback">
</picture>
Hamburger Menu (for complex navigation):
/* Mobile: Show hamburger */
.mobile-menu {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background: white;
z-index: 1000;
}
.hamburger {
display: block;
width: 44px;
height: 44px;
padding: 8px;
}
.mobile-menu.active {
display: block;
}
/* Desktop: Show full navigation */
@media (min-width: 768px) {
.hamburger {
display: none;
}
.desktop-nav {
display: flex;
}
}
Fixed Header (stays accessible during scroll):
header {
position: sticky;
top: 0;
z-index: 100;
background: white;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
Largest Contentful Paint (LCP): < 2.5 seconds
First Input Delay (FID): < 100 milliseconds
Cumulative Layout Shift (CLS): < 0.1
/* Lazy loading for images */
<img src="image.jpg" loading="lazy" alt="Description">
/* Aspect ratio to prevent layout shift */
.image-container {
aspect-ratio: 16 / 9;
}
/* Optimize animations */
.animated-element {
will-change: transform; /* Hint to browser */
transform: translateX(0); /* Use transform instead of left/margin */
}
1. HTTPS Required
2. Web App Manifest
Create manifest.json in your root directory:
{
"name": "Your App Name",
"short_name": "App",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#007bff",
"icons": [
{
"src": "/icons/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/icons/icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
3. Service Worker for Offline Support Basic service worker structure:
// sw.js
const CACHE_NAME = 'v1';
const urlsToCache = [
'/',
'/styles/main.css',
'/scripts/main.js'
];
self.addEventListener('install', event => {
event.waitUntil(
caches.open(CACHE_NAME)
.then(cache => cache.addAll(urlsToCache))
);
});
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request)
.then(response => response || fetch(event.request))
);
});
4. Add to Home Screen Prompt
// Detect install prompt
let deferredPrompt;
window.addEventListener('beforeinstallprompt', (e) => {
e.preventDefault();
deferredPrompt = e;
// Show custom install button
showInstallButton();
});
Color Contrast:
Keyboard Navigation:
/* Clear focus indicators */
button:focus,
a:focus,
input:focus {
outline: 2px solid #007bff;
outline-offset: 2px;
}
/* Skip to content link */
.skip-link {
position: absolute;
top: -40px;
left: 0;
background: #000;
color: white;
padding: 8px;
text-decoration: none;
z-index: 100;
}
.skip-link:focus {
top: 0;
}
ARIA Labels:
<!-- Screen reader support -->
<button aria-label="Close menu">
<span aria-hidden="true">×</span>
</button>
<nav aria-label="Main navigation">
<!-- Navigation items -->
</nav>
<img src="chart.png" alt="Sales increased 25% in Q4 2024">
Touch devices don't support hover states. Design with tap/press interactions:
Bad:
/* Don't rely on hover for essential info */
.tooltip {
display: none;
}
.element:hover .tooltip {
display: block;
}
Good:
/* Use tap/press states */
.element:active .tooltip,
.element:focus .tooltip {
display: block;
}
Support common mobile gestures:
// Touch event handling
let touchStartX = 0;
let touchEndX = 0;
element.addEventListener('touchstart', e => {
touchStartX = e.changedTouches[0].screenX;
});
element.addEventListener('touchend', e => {
touchEndX = e.changedTouches[0].screenX;
handleSwipe();
});
function handleSwipe() {
if (touchEndX < touchStartX - 50) {
// Swipe left
}
if (touchEndX > touchStartX + 50) {
// Swipe right
}
}
When reviewing mobile designs, verify:
1. Tiny Touch Targets
/* BAD - Too small */
.link {
font-size: 12px;
padding: 2px 4px;
}
2. Desktop-First Thinking
/* BAD - Requires override for mobile */
.element {
width: 1200px; /* Doesn't fit mobile */
}
@media (max-width: 768px) {
.element {
width: 100%; /* Unnecessary override */
}
}
3. Ignoring Touch Interactions
/* BAD - Hover only */
.dropdown:hover .menu {
display: block;
}
4. Fixed Widths
/* BAD */
.container {
width: 960px;
}
/* GOOD */
.container {
max-width: 960px;
width: 100%;
padding: 0 16px;
}
5. No Viewport Meta Tag
<!-- Always include this -->
<meta name="viewport" content="width=device-width, initial-scale=1">
Minimum Test Matrix:
Browser DevTools:
Performance Testing:
Accessibility Testing:
Cross-Browser Testing:
1. Start with Mobile Wireframes
2. Build Mobile-First CSS
3. Optimize Performance
4. Add Touch Interactions
5. Implement PWA Features (if applicable)
6. Accessibility Audit
7. Cross-Device Testing
Mobile-first design is not optional in 2025—it's essential. By following these guidelines, you'll create experiences that:
✅ Work beautifully on all devices ✅ Load fast and perform smoothly ✅ Are accessible to all users ✅ Convert better and engage more effectively ✅ Rank higher in search results (mobile-first indexing)
Remember: Design for mobile constraints first, then progressively enhance for larger screens. This ensures your design works where it matters most—on the devices most users rely on daily.