Skip to main content

Composition (layout primitives)

The theme’s composition layer (CUBE CSS) provides layout-only primitives. They don’t set colours or typography — use them for structure, then add blocks and utilities.

All primitives live in assets/css/general/composition.css and use the spacing and container tokens from Spacing and Typography.

Container

Centers content, applies max-width and horizontal padding (gutter).

ClassPurpose
.mrc-containerDefault: max-width --mrc-container-wide (1100px), padding from --mrc-page-gutter
.mrc-container--narrowTighter max-width for reading (e.g. --mrc-content-width / 72ch)

Stack

Vertical rhythm with consistent gap between children.

ClassGap
.mrc-stackDefault --space-4
.mrc-stack--s--space-2
.mrc-stack--m--space-4
.mrc-stack--l--space-6
.mrc-stack--xl--space-8
.mrc-stack--section--space-9

Cluster

Horizontal wrapping row (nav, button groups, inline clusters). Gap-controlled.

ClassPurpose
.mrc-clusterDefault gap --space-4
.mrc-cluster--s / --m / --l / --xlGap size
.mrc-cluster--betweenjustify-content: space-between
.mrc-cluster--endjustify-content: flex-end
.mrc-cluster--centerjustify-content: center

Grid

Responsive columns with optional auto-fit.

ClassPurpose
.mrc-grid1 column by default; gap --space-6
.mrc-grid--2 / --3 / --42, 3, or 4 columns (minmax-based)
.mrc-grid--autoAs many columns as fit (auto-fit, min ~250px)
.mrc-grid--gap-s / --gap-m / --gap-l / --gap-xlOverride gap

Children have min-width: 0 so text wraps correctly.

Split

Two-column layout; collapses to one column below 768px.

ClassAbove 768px
.mrc-split--60-4060% / 40%
.mrc-split--50-5050% / 50%
.mrc-split--40-6040% / 60%

Switcher

Multi-column that flips to single column when space is tight. Uses a threshold (width) to decide when to stack.

ClassThreshold (approx)
.mrc-switcher--225rem
.mrc-switcher--340rem
.mrc-switcher--455rem

Use for card rows or feature blocks that should stack on smaller viewports without a hard breakpoint.


Use these primitives everywhere; avoid one-off layout CSS. For component-level layout (hero, cards, footer), combine primitives with block styles in site/ and blog/.