DEV Community

Cover image for Do you code mobile-first?
Madza
Madza Subscriber

Posted on

Do you code mobile-first?

According to Statcounter, the device market share in 2021 Q1 is:

54.25% - Mobile
42.9% - Desktop
2.85% - Tablet

What is your preferred dev workflow?
Do you code mobile-first? Or do you design for desktop and then work on responsiveness for the mobile afterward?

Latest comments (43)

Collapse
 
sdifiore profile image
Sergio Di Fiore

I actually develop in Xamarin and deveope regularly for Mobile as well as for Windows Desktop... As for web I make resposive from the very begining...

Collapse
 
brandonwallace profile image
brandon_wallace • Edited

I start projects mobile first. It is easier to start at the mobile size in my opinion.
It is a nice challenge of getting a design to look good on a small screen. I even check mobile landscape view for when the phone is turned sideways.

@media only screen and (orientation: landscape) and (min-height: 320px) and (max-width: 600px) {
    /* code */
}
Enter fullscreen mode Exit fullscreen mode

The key is to make a drawing of the way it will look on mobile, tablet, and desktop before writing code.

I think that older developers go desktop first and newer developers lean more towards mobile first.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

It depends, but I mostly code for myself.

  • For Electron-like webapp, desktop first; then adapt for mobile.
  • For mobile-enabled webapp / Cordova, mobile first, by some options in DevTools console.
  • For content-first websites, mobile first as well.

I have never (yet) code Tablet-first, or Touchscreen-first, now that you mentioned.

Collapse
 
natalia_asteria profile image
Natalia Asteria

I usually code mobile-first because most of the time I code on my tablet.

Collapse
 
disgustingdev profile image
disgusting-dev

Totally depends on your core audience

Usually the most usable device might be defined before the actual development stage - when UX-responsible person/department goes for user research to understand major needs and issues of the user

knowing that, design tries to adjust fastest possible way of user journey - and if this is a PC, first design (and development) will be done on PC

If this is client-facin app (some online portal for everyone) - most probably it will be used from smartphone - so mobile-first comes there

Collapse
 
shanah profile image
Shana

desktop then mobile. its more natural for me....although alot of people say otherwise.

Collapse
 
koas profile image
Koas

Desktop first, since it usually is the most complex design. Going down is most of the time turning flex directions from row to column.

Collapse
 
alphavader profile image
KB

Ill do mobile fist, but my clients not very often.. Even i advise them to.. Often it is desktop, and some responsive grid experience but not a full designed mobile first experience

Collapse
 
jankapunkt profile image
Jan Küster 🔥

I mostly code in the browser with mobile view active as we deploy all our apps as PWA. The great thing is, that you can already develop against a good bunch of mobile-related events and viewports without the need for a mobile. For testing beyond that, I deploy a local version to my home-network's integrated Intel NUC and test with a real mobile. Works out very good for us.

Collapse
 
zacharysarette profile image
Zach

Desktop first. Then 4k. Then mobile.