Viewport, not physical resolution
Applies to All viewports
A viewport is the space a browser or app actually has, in CSS pixels. It is not the screen's resolution and not the device. One CSS pixel is drawn with several physical ones, and a window can be any size on any device.
Why?
Design responds to the space available. Two people on the same laptop have different viewports if one has the window split in half.
Common mistakes (3)
- A breakpoint set at a device's physical pixel width.
- Layouts named after devices: the iPad layout, the iPhone layout.
- Assuming a phone is touch and a desktop is a mouse. Viewport and input method are separate.
Senior designer note“Design for the space available, not the name of the device.”
Official guidanceMaterial
- Material
Window size classes are explicitly not determined by the size of the device screen, but by the window size available to the app. Split-screen, resizable windows and folding all change it while the app runs.
Android Developers, Use window size classes(opens in a new tab)Design-system convention
Applies to all viewports