First let me begin by defining what mobile first is as their are multiple layers to it.
Layer 1: The most important part, Construction order of you css media queries.
given the screen sizes of
1140px - widescreen
992px - desktop
768px - tablet
480px - phone
Code: Select all
/**
* Mobile First - Desktop only
*/
@media (min-width: desktop - 1) and (max-width: widescreen - 1) { }
/**
* Non Mobile Fist - Desktop Only
*/
@media (max-width: widescreen - 1) and (min-width: tablet + 1) { }
Layer 2: Progressive enhancement
This is the addition of more robust features that require more space as the screen size increases. It is easier to start from a clean base the bar minimum required content for the app and progressively add enhancements as the screen size increases. This is mainly handled through proper componentisation of elements and the use of css hiding utilities
Layer 3: Design First
This is the one most of you may have an issue with and is not really necessary but is still beneficial. Given Layer 2 it is easier to design a theme and code the semantics based on the requirements of the content for a mobile device given that it is the most restrictive.
Thoughts and suggestions.
Keep in mind that we have a completely separate topic to discuss other ways of handling how to render content on different devices!