Become a 2018 ready Web Developer By Learning Flexbox and CSS Grid
A collection of resources to learn tomorrow’s technologies today.
Although I’ve referred to them as tomorrow’s technologies, Flexbox and Grid are supported by nearly all modern browsers. What makes these seem futurisitic is that very few web developers are aware of them. Even fewer use these while designing websites, instead relying on css frameworks like bootstrap, foundation and materialize. This despite many advantages offered over the frameworks.
The 3 layout Options
Box Model and Flexbox are useful for reasoning about laying out smaller components in a single direction. An example of this would be navigation items inside a navbar. Whereas CSS grid is used for laying out elements of the webpage along two axes. Think laying out navbar, main section and footer responsively.
Flexbox offfers the following benfites compared to tradtional methods like Box Model
- Easy to get started : Most Basic layouts can be achieved by using only three properties approprtiately: display, justify-content and align-items
- Painless vertical and horizontal centering of items
- You can manipulate inline elements easily.
You can read more about advantages of flexbox at bitsfoco.de.
Resources to Learn Flexbox
Handy refrence : MDN flexbox Docs
- HTML Basics.
- CSS syntax and selectors
- CSS Values and Units
- Cascade and Inheritance
- Box Model
The Action Plan
- Understand flexbox through GIFS
- Your first visit to MDN docs : Get a high level overview by reading this page
- Get a more hands-on high level overview from this another brilliant medium article and build a music app over 90 minutes
- Fight off zombies while learning flexbox. I can’t recommend flexbox zombies enoguh!
- Alternatively if you prefer a tutorial with no bloodshed, help some frogs with your flexbox skills
- If you prefer video courses and want to learn from a brilliant instructor, check out Wes Bos’s WTF(What the Flexbox?!)
All the above resources are completely free. Once you are comfortable with flexbox, you can start learning CSS grid.
CSS Grid: What it is and How to learn
A grid is simply a collection of horizontal and vertical lines creating a pattern against which we can line up our design elements. They help us to create designs where elements don’t jump around or change width as we move from page to page, providing greater consistency on our websites.A grid will typically have columns, rows, and then gaps between each row and column — commonly referred to as gutters.
CSS Grid is one of a few new specifications for CSS — essentially, a guideline that defines a new way of implementing grid based layout without using 3rd party frameworks. It offers something new (and improved) in the way of layout control and works on top of existing layout tools like Flexbox.If Flexbox works from the content out, Grid works from the content grid in.
It is a very new technology with the following benefits
- Lighter websites : you only include the css that’s required, not all the extra features that come with a heavy framework.
- Easier to customise than frameworks. Your websites will be much more distinguished.
- Easier to reason about layout. No more memorizing and sprinkling around quirky class names.
- Unless you need to support older versions of I.E, you can start using it today.
- It allows for both complete control over layout placement, or you can let the browser do the work.
This article explain further how Grid will reduce a lot of issues we web developers face
- Everything upto flexbox
- Media Queries
The Action Plan
- Utilize Paretto’s principle: Learn the 20% essential to master the remaining 80% of css grid by dedicating 25 miutes to this medium post
- Back to MDN: time for some high level overview
- A more visual overview in this beautiful guide
- Grow carrots while learning grid
- Video time, this youtube series by the always excellent net ninja.
- Enroll to this awesome scrimba course (video + interactive)
As with flexbox, the above resources are completely free. Take a moment to appreciate all the wonderful folks who dedicate their time and efforts to create such wonderful works and release it for free.
There is one benefit common to both Flexbox and CSS grid in addition to being future-proof.
While learning and using these technologies, you will not have any framework to hide behind. You will have to really know your CSS and why each element gets laid out the way it does. This is what will distinguish you from an average developer who has mastered her framework of choice.
Do share in the responses if you know of more wonderful resources.