Responsive Web Design (RWD) has introduced a new layer of work for everyone building responsive websites and apps. When we have to test our work on different devices and in different dimensions, wherever the content breaks, we need to add a breakpoint and test again.
This can happen many, many times. So, building a website or app will take a bit longer than it used to.
To make things a little more interesting, as web designers and developers, we need to be mindful of how the content is laid out at different dimensions and how a grid can help us structure the content to different layouts.
Now that we have mentioned grids, have you ever asked yourself, "what do we use a grid for anyway?"
To borrow a few terms from the design industry and answer that question, we use a grid to allow the content to have rhythm, proportion, and balance. The objective is that those who use our websites/apps will have a more pleasant experience with our content, since it will be easier to scan (rhythm), easier to read (proportion) and organized (balance).
In order to speed up the design and build processes while keeping all the content properly formatted in different dimensions, many authors and companies have created CSS frameworks and CSS grids that contain not only a grid but also many other features and styles than can be leveraged by using a simple class name.
As time goes by and browsers start supporting more and more CSS3 properties, such as Flexbox, it'll become easier to work with layouts. This will render the grids inside CSS frameworks almost unnecessary.
Let's see what CSS grids, CSS frameworks, UI kits, and Flexbox are all about and how they can help us with RWD.
In this chapter, we're going to cover the following topics:
A grid is a set of visual guidelines (vertical, horizontal, or both, hence the term grid) that help define where elements can be placed. Once the elements have been placed, we end up with a layout.
The benefit of using a grid is that the elements placed on it will have a harmonious flow along the pages, enhancing the user experience in terms of legibility, layout consistency, and good proportions between the elements.