EZPZ Flexbox Grid

Default features

This page contains examples of the grid features that are enabled by default.

1: Overwriting defaults

To generate a functional grid out of the box, several default settings are used. Most of these defaults can be overwritten through the use of variables, most notably: wrapping behaviour, alignment and content stretching behaviour.

For a full list of all the default settings that can be overwritten please refer to the settings documentation.

2: Horizontal layout

The most basic form of the grid, each .cell element will take up an equal amount of horizontal space in the containing .grid element.

By default all .cell elements will maintain the same height as all other cells on the same row within a .grid element, similar to the way flexbox handles the height of flex-items. This behaviour can be changed through the use of the optional alignment classes.

1a
1b
1c
2a
3a
3b
4a

3: Vertical layout

Cells within a .grid element can be vertically ordered by adding the .grid--vertical class.

Please note that .cell elements with specific sizes (for example ¼ of the screen width), will not occupy ¼ of the viewport height when using a vertical layout. Cells will merely be converted to rows that take up the height of it's child elements.

1
2
3
4

4: Nested grid sections

Grids can be nested by adding a new .grid element within a .cell element. The width of the parent cell will dictate the width of the grid. All other behaviour remains the same as in the basic setup.

1
1.1
1.2
2
2.1
2.2

5: Cells with specific sizes

By adding a .cell--{fraction} class to a .cell element a percentual width can be applied to the cell. A .cell--1/4 class means that the element will take up one quarter of the available space. An element with the .cell--1/2 class will take up half the available space etc.

1
2

By only applying a .cell-{fraction} to specific cells, a width can be set for these cells. The remaining cells will automatically divide the remaining space within the grid section equally.

1
2
3

6: Stretching cell content

By default all direct children of specific or multiple cells within a grid section can be forced to stretch so they take up the full width and height of the parent cell.

6.1: For all cells within a grid section

The direct children of all cells within a grid section can be forced to stretch by adding the .grid--content-stretch class to the .grid element.

If the default content stretch behaviour has been set to stretch the .grid--content-unstretch class can be used to disable this behaviour for a specific grid section.

1a
1b
1c
2a
3a
3b
4a

6.2: For specific cells

The direct children of a specific cell can forced to stretch by adding the .cell--content-stretch class to the .cell element.

If the default content stretch behaviour has been set to stretch the .cell--content-unstretch class can be used to disable this behaviour for a specific cell.

1a
1b
1c
2a
3a
3b
4a