The list of Flexbox properties with:
- live demos
- code snippets
- definitions from the W3C Flexbox specification
Source: news.ycombinator.com
The list of Flexbox properties with:
❤ The best intro to Flexbox
!
The Grid Container and Grid Items
Grid Lines
Grid Columns, Grid Rows, and Grid Tracks
Grid Cells
Grid Areas
Grid Lines
Grid Columns, Grid Rows, and Grid Tracks
Grid Areas
screenshots with illustrations and demos +1
checkout codepen’s
The display property is one of the most important CSS properties we use for layout. Most of us would have used block, inline and none. table and inline-block are also quite common. The new darling is definitely flex, because it’s a display property that was created specifically for layout. The upcoming grid (currently still being actively worked on) is another layout-specific property that we’ll soon have in our arsenal as well.
Those we know quite well already
New kids on the block
The relatively obscure and experimental
Through my experience of building various responsive designs, I learnt a
1. “Use flexbox”
Would love to BUT Flexbox isn’t ready for prime time, well unless you don’t care about supporting IE users or the other bugs in FF, Chrome or Safari. Checkout the known issues from caniuse flexbox. Can you say “flexbox polyfill” ;)
2. “Don’t use !important in your code”
Twitter Bootstrap and Foundation Sites didn’t get the memo
Flexbox is awesome, but it introduces many new concepts that can make it difficult to use. These interactive examples will show you practical ways to use it to build UI components. They start out simple and get more complex near the end. You can start using these patterns in your own code right away, though I recommend you apply accessibility best practices to the markup (like using semantic HTML5 elements).
todo
The JavaScript is now written in ES2015, which means if you consume the js/ folder of the Foundation package as part of a build process, it will need to be transpiled using Babel. There are many ways to use Babel, including plugins for every build system imaginable.
Note that this doesn't change anything about how you write JavaScript. You can use the new ES features if you want, or you can keep writing code how you always have.
Color Palette
We created a new wrapper around the color variables like $primary-color, $secondary-color, and so on, called $foundation-palette. Adding new colors to this palette allows you to change what CSS classes buttons, callouts, labels, etc. use to change colors.
Flexbox Mode
Users of the flex grid will likely want to switch their project over to flexbox mode, which converts a handful of float- and table-based components to use display: flex instead.
To upgrade to flexbox mode: