Mobile-First Design
Learn why starting with mobile styles and adding complexity for larger screens leads to better websites.
The problem with desktop-first
Many developers instinctively design for desktop first — they build a complex multi-column layout, then try to squeeze it into a phone screen using max-width media queries. This approach has serious problems. First, mobile users (who make up the majority of web traffic) download all the complex desktop CSS even though they never use it. Second, it's much harder to simplify a complex layout than to enhance a simple one. You end up writing lots of override rules to undo desktop styles on mobile: hiding sidebars, unstacking columns, shrinking fonts. It feels like you're fighting your own code.
Mobile-first flips this approach: you write the simplest styles first (for mobile), then progressively add complexity for larger screens using min-width media queries. The base CSS is lean and fast — perfect for phones on slow connections. Larger screens add features: extra columns, visible sidebars, larger images. This strategy is called progressive enhancement — start with a solid foundation and layer on improvements. Google, GitHub, and most modern web teams design mobile-first because it produces smaller CSS files, fewer override hacks, and a better experience for the majority of users.