Responsive design is a web design method aimed at creating online user interfaces that provide the best viewing experience, including easy reading and navigation, on various screen sizes.
A responsive user interface adapts the layout to the screen size by using fluid, proportion-based grids, flexible images, and CSS3 media queries. Using responsive design, you can create Visualforce pages that look great and work well on phones and tablets.
Standard Salesforce app pages use responsive design to provide device-optimized layouts. The primary technique is a stacked single-column layout for phones, and a side-by-side, two-column layout for tablets. The page is the same for all devices, and adapts to the screen size it’s displayed on.
The SLDS Grid System
The Lightning Design System (SLDS) uses a grid based on Flexbox to provide a flexible, mobile-first, device-agnostic scaffolding system. The grid system lets you divide your page into rows and columns and define layout variations for different-sized screens. Grids can be nested to create complex layouts.
The grid system has two parts, the grid wrapper (the slds-grid class) and the columns within it (the slds-col class). By default, columns are sized relative to their content.
You can also specify the column sizes manually with sizing helpers from SLDS. They use a slds-size--X-of-Y format where X represents a fraction of the total space Y. For example, slds-size--1-of-2 represents a width that is 50 percent of the available space. Using the manual sizing class helpers, you can specify column ratios across the following grids – 2, 3, 4, 5, 6, and 12.
Create a Responsive Design Page Using SLDS
Open the Developer Console and click File | New | Visualforce Page. Enter SLDSResponsivePage for the page name.
In the editor, replace any markup with the following.