Breakpoint-dependent switching of flex direction on card components
In this recipe, we will ease into using the flexbox grid in Bootstrap 4 with a simple example of switching the flex-direction property. To achieve this effect, we will use a few helper classes to enable the use of Flexbox in our recipe. To get acquainted with the way Flexbox works in Bootstrap, check out the official documentation at https://v4-alpha.getbootstrap.com/utilities/flexbox/ .
Getting ready
To get started with the recipe, let's first get an idea of what we will make. Navigate to chapter8complete/app/
and run harp server
. Then, preview the completed recipe at localhost:9000/recipe08-01
. You should see a simple layout with four card components lined up horizontally.
Now, resize the browser, either by changing the browser's window width or by pressing F12 (which will open developer tools and allow you to narrow down the viewport by adjusting the size of developer tools). At a certain breakpoint (md, i.e. the medium...