Skip to content
tezvyn:
Menu

Mobile-First Design: Start Small, Then Scale Up

Source: developer.mozilla.orgMediumHow cards are made

Mobile-First Design: Start Small, Then Scale Up

Mobile-first design means building for the smallest screen first, then enhancing for larger ones. This ensures a solid baseline experience on phones, where most users are. The footgun is thinking it's just CSS, not a content-first strategy.

Why it exists

The old approach to web design was desktop-first. Developers built a complex site for large screens and then tried to shrink or hide parts of it to fit a phone, a process called "graceful degradation." This often resulted in slow, clunky, and frustrating mobile experiences. As mobile traffic began to dominate, a better approach was needed that treated phones as first-class citizens, not afterthoughts.

The mental model

Think of it like packing for a trip. With a small backpack (mobile), you pack only the absolute essentials. If you later get a bigger suitcase (desktop), you can add more luxury items (extra features, sidebars, complex layouts), but your core essentials are already packed and ready. The reverse—trying to cram a suitcase's contents into a backpack at the last minute—is a mess.

How it works

Mobile-first is both a strategy and a technical pattern. Strategically, it forces you to identify the core content and functionality of your application. What is the one thing a user must be able to do? That's your starting point. Technically, this is implemented with CSS using min-width media queries. You write your base styles for the smallest screens first. Then, as the screen size increases, you use media queries like @media (min-width: 768px) to add styles, change layouts, and reveal more complex components. This is a form of progressive enhancement.

When to use it

This is the default, recommended approach for virtually all new web projects. It's especially critical for public-facing websites, e-commerce platforms, and news sites where mobile traffic often exceeds 50%. It encourages better performance, accessibility, and a more focused user experience by forcing you to prioritize.

When not to use it

The only real exceptions are for applications that are guaranteed to be used only on desktops. Examples include complex, specialized internal tools like a network operations dashboard or a professional video editing web app. Even in these cases, using a responsive approach is often wise for future-proofing. The desktop-first approach is now considered a legacy practice.

One canonical example

A site's navigation. In a mobile-first design, the default style would be a simple "hamburger" menu icon that toggles a vertical list of links. This works well on a narrow screen. Then, you'd add a media query for a minimum width, say 1024px, that transforms the navigation into a full, horizontal bar across the top of the page. You start with the simple, universal solution and add the more complex layout for screens that can support it.

Interview question

Which statement best describes a core principle of the mobile-first design strategy?

  • a.It guarantees that the user interface will look identical across all screen sizes for brand consistency.
  • b.It primarily uses max-width media queries to hide non-essential elements on mobile devices.
  • c.It prioritizes identifying essential content and functionality before adding complex features for larger displays.Correct
  • d.It involves designing for the largest screens first, then progressively simplifying for smaller devices.
Why?

Mobile-first design strategically forces you to identify the core content and functionality first, ensuring a solid baseline experience before enhancing for larger screens. Option D describes the outdated desktop-first approach, which mobile-first aims to replace.

Just read this? Test yourself on what you have been reading.

Read the original → developer.mozilla.org

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on css — each one lists the topics its interview covers.

See open roles