This container class sets up a multi-column layout with two, three, or four columns. It's content-agnostic, but not all Protocol components will work within a multi-column layout.
- A theme class sets the number of columns:
- Columns are evenly sized and evenly spaced. Every column in a group is the same width with the same gutters (space between columns).
- We don't currently have options for an uneven distribution of columns, such as two columns in one-third/two-thirds proportions. If you need that kind of layout you'll need to use an alternative method.
- This uses CSS grid, which is well supported in modern browsers but not supported in any browsers release prior to 2018. Older browsers will ignore the column layout and content will be linearized by default. If you need a multi-column layout in older browsers you'll need to use an alternative method.
- The contents of each column should be in its own container element that must be a direct child of the multi-column container, as shown in the example. The kind of element doesn't matter (
img, etc), it just needs to be a direct child of the container.
.mzp-l-columnsclass doesn't apply a width; without any other constraints the column container will fill the width of its own container, which may be the browser window. Use this in conjunction with a
.mzp-l-contentcontainer, either nested or applying both classes to the same container.
- A column's width isn't explicit; the width of a column depends on the number of columns and the width of the container (which also varies).
- Gutters between columns are 64px at most viewport sizes, but expand to 80px in extra large viewports.
- Column layouts change automatically at different breakpoints, or in different container widths. See the demo.
- Small viewports and containers are always a single column.
- In medium viewports or containers, three columns will be a single column.
- In medium viewports or containers, four columns will be two columns with the third and fourth wrapping under the first and second.
- Avoid nesting
.mzp-l-columnscontainers. It gets weird.