Component documentation

Card grid

CSS Grid based grid for laying out cards.

Card grid with auto fitted items

#

Without configuration (see below) the grid is auto fitted with items. Cards have a minimum width of 25.6rem.

Content

Content

Content

Content

Content

Content

Card grid with predefined columns

#

To define cell widths within a direction-level, instead of the individual cell level, add the class .[size]-up-[n] to a card-grid, where [n] is the number of cells to display per direction, and [size] is the breakpoint at which to apply the effect.

Available sizes: small, medium, large, extra-large

Max columns: 6 (can be overridden by setting $o-card-grid-max-columns)

Content

Content

Content

Content

Content

Content

Card grid with statically placed item

#

You can place items fixed by using wrapping the static item in a .o-card-grid__item container. You can then define the start column/row and the amount of columns/rows the item spans. This is the same syntax as used for defining start/end rows/columns on css grid items.

Examples:

First row, third column

.o-card-grid__item(
    data-row=1,
    data-column=3
)

Second row, spanning 3 columns

.o-card-grid__item(
    data-row=2,
    data-column-span=3
)

Second column, spanning two rows

.o-card-grid__item(
    data-column=2,
    data-row-span=2
)

Last column, spanning 2 rows

.o-card-grid__item(
    data-column=-1,
    data-row-span=2,
)

Content

Content

Content

Content

Content

Content

Content

Content

Content

Content