Updated

Breakpoints

We try to follow mobile first approach as it has been proven it generates less code an is easier to maintain. When creating a mobile layout it is usually a single column stack with margins and padding, which is already native for HTML elements. On the other hand, deskotop layouts are more complex with flexbox and grid, which deviates form native HTML layout.

Style for mobile, structure (think) for desktop!

When setting up a component the initial style should be for mobile-first as that will have less code. Usually the desktop is more complex which will required a different HTML structure from mobile. For this reason, the structure should reflect the desktop structure.

Deciding on a specific list of breakpoints can be a subjective topic.
In favor of standardization throughout our projects, here is the proposed list of breakpoints:

NameMinimal Width
mobile0
phablet600px
tablet768px
laptop1024px
desktop1200px
large1400px

SCSS

$site-breakpoints: (
phablet: 600px,
tablet: 768px,
laptop: 1024px,
desktop: 1200px,
large: 1400px,
);

Use the following mixins to write media queries based on the enum above.

// Makes the @content apply to the given breakpoint and wider.
@include media-breakpoint-up();

// Makes the @content apply to the given breakpoint and narrower.
@include media-breakpoint-down();

// Makes the @content apply between the min and max breakpoints
@include media-breakpoint-between();

// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
@include media-breakpoint-only();

Example

@include media-breakpoint-up(tablet) {
body { font-size: 87%; }
}

Resolutions

Bellow is the table with the most common device screen resolutions. For more details refer to CSS Media Query Breakpoints.

CategoryWidthDevice
Mobile, portrait320pxiPhone SE
375pxiPhone 6, 7, 8, X
414pxiPhone 8 Plus
Mobile, landscape568pxiPhone SE
667pxiPhone 6, 7, 8
736pxiPhone 8 Plus
812pxiPhone X
Tablet, portrait768pxiPad Air, iPad Mini, iPad Pro 9"
834pxiPad Pro 10"
Tablet, landscape1024pxiPad Air, iPad Mini, iPad Pro 9"
1024pxiPad Pro 12" (portrait)
1112pxiPad Pro 10"
Laptop displays1366pxHD laptops (768p)
1366pxiPad Pro 12" (landscape)
1440px13" MacBook Pro (2x scaling)
Desktop displays1680px13" MacBook Pro (1.5x scaling)
1920px1080p displays
Made with ❤ in Neopix HQ