1 of 24

Mobile First? Desktop First? �Go Basic First!

by Elad Shechter

@eladsc

2 of 24

Who Am I?

  • 14 Years Web Developer
  • CSS/HTML Architect at Investing.com
  • Founder of CSS Masters Israel Community
  • Writer at medium.com/@elad
  • Speaker

3 of 24

How to arrange your project

Using preprocessor

4 of 24

5 of 24

6 of 24

Where to Put CSS Media Queries?

*

7 of 24

8 of 24

Media queries in variables.

9 of 24

Applying variables in the components.

10 of 24

Open or Closed Breakpoints?

11 of 24

Open Breakpoints

12 of 24

Closed Breakpoints

13 of 24

Open or Closed Breakpoints?

*

14 of 24

Open Breakpoints (Example from the Guardian)

Overrides is EVIL!

15 of 24

Use only Closed Breakpoints!

unless it is the last breakpoint

16 of 24

What if We Need the Same Rule for Two Breakpoints?

17 of 24

Use the the same styles in more than 1 breakpoint

using the “,” sign means “or”.

18 of 24

The Problem with

Mobile First

and

Desktop First

19 of 24

“Mobile First” and “Desktop First” (case study)

“Desktop Mode”

“Mobile Mode”

20 of 24

What is the solution?

21 of 24

Go “Basic First”!

22 of 24

Basic First

“”Only common styles which is correct for all media rules will be without media query rule

23 of 24

Basic First - References

bit.ly/33dZ3Zm

bit.ly/2XDNZUg

Will tweet in the end of the talk

@eladsc

24 of 24

Let’s Keep Talking...

Join! CSS Masters Israel

Facebook Group

  • The End -

@eladsc

By Elad Shechter