Utilities
Utility Classes
Utilities
Hybrid utility system supporting both Industrial T-shirt sizes (3xs..6xl) and Mathematical rhythm units (1-12, half, trim, leading).
| Name | Description |
|---|---|
.p-*, |
.pt-, .pb-, .pl-, .pr-, .px-, .py- Padding scale utilities. |
.m-*, |
.mt-, .mb-, .ml-, .mr-, .mx-, .my- Margin scale utilities. |
.gap-*, |
.gap-x-, .gap-y- Grid and flex gap utilities. |
.w-*, |
.h-, .max-w-, .min-w-, .max-h-, .min-h-* Sizing scale utilities. |
.text-muted, |
.text-subtle, .text-accent Foreground text color utilities. |
.bg-surface, |
.bg-background Background color utilities. |
.border, |
.border-accent, .border-transparent Border stroke utilities. |
.rounded, |
.rounded-sm, .rounded-lg, .rounded-full Border radius utilities. |
.shadow, |
.shadow-sm, .shadow-md, .shadow-lg, .shadow-xl Elevation shadow utilities. |
.flex, |
.inline-flex, .grid, .inline-grid, .block, .inline-block, .hidden Layout display utilities. |
Padding and margin
<div class="bg-background border rounded p-2">p-2: padding on every side</div>
<div class="bg-background border rounded px-4 py-2 mt-2">px-4 py-2 and mt-2</div>
<div class="bg-background border rounded p-half mt-2">p-half: half a baseline</div>
Live
Gap and layout
<div class="flex flex-wrap gap-2">
<div class="bg-background border rounded p-2">flex</div>
<div class="bg-background border rounded p-2">with</div>
<div class="bg-background border rounded p-2">gap-2</div>
</div>
<div class="grid-3 gap-half mt-2">
<div class="bg-background border rounded p-2">grid</div>
<div class="bg-background border rounded p-2">gap-half</div>
<div class="bg-background border rounded p-2">3 columns</div>
</div>
Live
Colour, border and radius
<div class="flex flex-wrap gap-2 no-rhythm">
<span class="text-muted">text-muted</span>
<span class="text-subtle">text-subtle</span>
<span class="text-accent">text-accent</span>
<span class="border p-2">border</span>
<span class="border-accent p-2">border-accent</span>
<span class="bg-background border p-2 rounded-sm">rounded-sm</span>
<span class="bg-background border p-2 rounded">rounded</span>
<span class="bg-background border p-2 rounded-lg">rounded-lg</span>
<span class="bg-background border p-2 rounded-full">rounded-full</span>
</div>
Live
Elevation
<div class="flex flex-wrap gap-3 no-rhythm" style="padding: var(--space)">
<div class="bg-background border rounded p-2 shadow-sm">shadow-sm</div>
<div class="bg-background border rounded p-2 shadow-md">shadow-md</div>
<div class="bg-background border rounded p-2 shadow-lg">shadow-lg</div>
<div class="bg-background border rounded p-2 shadow-xl">shadow-xl</div>
</div>
Live
Type size and alignment
<p class="text-xs">text-xs</p>
<p class="text-base">text-base</p>
<p class="text-xl">text-xl</p>
<p class="text-3xl">text-3xl</p>
<p class="text-center">text-center</p>
<p class="text-right">text-right</p>
Live
text-xs
text-base
text-xl
text-3xl
text-center
text-right
Generated classes
One scale, stamped into 37 CSS properties by @include generate-scale(prefix, property) — one row below per call in the source. .{prefix} is the bare class (the scale’s default entry below); .{prefix}-{suffix} covers the rest of the scale.
| Suffix | Value |
|---|---|
| full | 100% |
| 0 | 0 |
| auto | auto |
| 3xs — Optical Scale | var(--scale-d5) |
| 2xs | var(--scale-d4) |
| xs | var(--scale-d3) |
| sm | var(--scale-d2) |
| base | var(--scale) |
| lg | var(--scale-2) |
| xl | var(--scale-3) |
| 2xl | var(--scale-4) |
| 3xl | var(--scale-5) |
| 4xl | var(--scale-6) |
| 5xl | var(--scale-7) |
| 6xl | var(--scale-8) |
| (bare) — Mathematical Unit Scale (1-12) | var(--space) |
| 2 | var(--space-2) |
| 3 | var(--space-3) |
| 4 | var(--space-4) |
| 5 | var(--space-5) |
| 6 | var(--space-6) |
| 7 | var(--space-7) |
| 8 | var(--space-8) |
| 9 | var(--space-9) |
| 10 | var(--space-10) |
| 11 | var(--space-11) |
| 12 | var(--space-12) |
| half | var(--space-d2) |
| trim — Vertical Rhythm Tokens | var(--trim) |
| leading | var(--leading) |
| Prefix | CSS property | Breakpoint | Classes |
|---|---|---|---|
w |
width |
— | .w / .w-{suffix} |
min-w |
min-width |
— | .min-w / .min-w-{suffix} |
max-w |
max-width |
— | .max-w / .max-w-{suffix} |
h |
height |
— | .h / .h-{suffix} |
min-h |
min-height |
— | .min-h / .min-h-{suffix} |
max-h |
max-height |
— | .max-h / .max-h-{suffix} |
m |
margin |
— | .m / .m-{suffix} |
my |
margin-block |
— | .my / .my-{suffix} |
mx |
margin-inline |
— | .mx / .mx-{suffix} |
mt |
margin-top |
— | .mt / .mt-{suffix} |
mr |
margin-right |
— | .mr / .mr-{suffix} |
mb |
margin-bottom |
— | .mb / .mb-{suffix} |
ml |
margin-left |
— | .ml / .ml-{suffix} |
p |
padding |
— | .p / .p-{suffix} |
py |
padding-block |
— | .py / .py-{suffix} |
px |
padding-inline |
— | .px / .px-{suffix} |
pt |
padding-top |
— | .pt / .pt-{suffix} |
pr |
padding-right |
— | .pr / .pr-{suffix} |
pb |
padding-bottom |
— | .pb / .pb-{suffix} |
pl |
padding-left |
— | .pl / .pl-{suffix} |
gap |
gap |
— | .gap / .gap-{suffix} |
gap-x |
column-gap |
— | .gap-x / .gap-x-{suffix} |
gap-y |
row-gap |
— | .gap-y / .gap-y-{suffix} |
sm:mt |
margin-top |
(max-width: $small) | .sm:mt / .sm:mt-{suffix} |
sm:mr |
margin-right |
(max-width: $small) | .sm:mr / .sm:mr-{suffix} |
sm:mb |
margin-bottom |
(max-width: $small) | .sm:mb / .sm:mb-{suffix} |
sm:ml |
margin-left |
(max-width: $small) | .sm:ml / .sm:ml-{suffix} |
sm:my |
margin-block |
(max-width: $small) | .sm:my / .sm:my-{suffix} |
sm:mx |
margin-inline |
(max-width: $small) | .sm:mx / .sm:mx-{suffix} |
sm:m |
margin |
(max-width: $small) | .sm:m / .sm:m-{suffix} |
sm:pt |
padding-top |
(max-width: $small) | .sm:pt / .sm:pt-{suffix} |
sm:pr |
padding-right |
(max-width: $small) | .sm:pr / .sm:pr-{suffix} |
sm:pb |
padding-bottom |
(max-width: $small) | .sm:pb / .sm:pb-{suffix} |
sm:pl |
padding-left |
(max-width: $small) | .sm:pl / .sm:pl-{suffix} |
sm:py |
padding-block |
(max-width: $small) | .sm:py / .sm:py-{suffix} |
sm:px |
padding-inline |
(max-width: $small) | .sm:px / .sm:px-{suffix} |
sm:p |
padding |
(max-width: $small) | .sm:p / .sm:p-{suffix} |
All classes
Width
Widths the generated w-* scale does not cover: viewport units (screen), intrinsic sizes (min, max, fit) and the reading and mobile measures.
| Class | Declares |
|---|---|
.w-screen |
width: 100vw !important |
.w-min |
width: min-content !important |
.w-max |
width: max-content !important |
.w-fit |
width: fit-content !important |
.min-w-screen |
min-width: 100vw !important |
.max-w-none |
max-width: none !important |
.max-w-screen |
max-width: 100vw !important |
.max-w-mobile |
max-width: var(--breakpoint-mobile) !important |
.max-w-prose |
max-width: var(--prose-width) !important |
.narrow |
margin-inline: var(--prose-inset) !important |
.max-w-wide, .wide:not(.prose *) |
max-width: calc(var(--prose-width) + (var(--space-4) * 2)) !important |
.max-w-page |
max-width: var(--page-max-width) !important |
Height
Heights the generated h-* scale does not cover: viewport units and intrinsic sizes.
| Class | Declares |
|---|---|
.h-screen |
height: 100vh !important |
.h-min |
height: min-content !important |
.h-max |
height: max-content !important |
.h-fit |
height: fit-content !important |
.min-h-screen |
min-height: 100vh !important |
.max-h-none |
max-height: none !important |
.max-h-screen |
max-height: 100vh !important |
Display
Display keywords. .hidden removes an element from the layout; the flex and grid helpers are under Flexbox and on the Grid System page.
| Class | Declares |
|---|---|
.block |
display: block !important |
.inline |
display: inline !important |
.inline-block |
display: inline-block !important |
.grid |
display: grid !important |
.hidden |
display: none !important |
Position
The positioning keywords.
| Class | Declares |
|---|---|
.relative |
position: relative !important |
.absolute |
position: absolute !important |
.fixed |
position: fixed !important |
.sticky |
position: sticky !important |
Flexbox
Flex containers and the usual alignment, wrapping and distribution helpers. Children of a .flex have their rhythm margin removed so it never stacks with the gap (see Rhythm).
| Class | Declares |
|---|---|
.flex, .flex-row, .flex-col |
display: flex !important |
.flex-1 |
flex: 1 1 0% !important |
.flex-row |
flex-direction: row !important |
.flex-col |
flex-direction: column !important |
.flex-wrap |
flex-wrap: wrap !important |
.flex-nowrap |
flex-wrap: nowrap !important |
.flex-far |
display: flex |
.flex-right |
display: flex |
.flex-left |
display: flex |
.items-start |
align-items: flex-start !important |
.items-center |
align-items: center !important |
.items-end |
align-items: flex-end !important |
.items-baseline |
align-items: baseline !important |
.items-stretch |
align-items: stretch !important |
.justify-start |
justify-content: flex-start !important |
.justify-center |
justify-content: center !important |
.justify-end |
justify-content: flex-end !important |
.justify-between |
justify-content: space-between !important |
.justify-around |
justify-content: space-around !important |
.justify-evenly |
justify-content: space-evenly !important |
Layout helpers
Centering, full-bleed breakouts and screen-height sections, for laying out a whole page.
| Class | Declares |
|---|---|
.center-content |
display: flex |
.center-horizontally |
margin-left: auto |
.center-vertically |
display: flex |
.no-body-margin |
margin-inline: calc((var(--page-padding) * -1)) !important |
.full-bleed |
width: 100vw !important |
.breakout |
width: min(100%, var(--page-max-width)) !important |
.stnd-screen-break |
border: none |
.stnd-screen-section |
width: 100% |
Typography: Size
The optical type scale as classes, .text-xs to .text-6xl; each is also reachable as .text-scale-*. They read the --scale-* tokens (Optical harmony scale).
| Class | Declares |
|---|---|
Aa.text-3xs, .text-scale-d5 |
font-size: var(--scale-d5) !important |
Aa.text-2xs, .text-scale-d4 |
font-size: var(--scale-d4) !important |
Aa.text-xs, .text-scale-d3 |
font-size: var(--scale-d3) !important |
Aa.text-sm, .text-scale-d2 |
font-size: var(--scale-d2) !important |
Aa.text-base, .text-scale |
font-size: var(--scale) !important |
Aa.text-lg, .text-scale-2 |
font-size: var(--scale-2) !important |
Aa.text-xl, .text-scale-3 |
font-size: var(--scale-3) !important |
Aa.text-2xl, .text-scale-4 |
font-size: var(--scale-4) !important |
Aa.text-3xl, .text-scale-5 |
font-size: var(--scale-5) !important |
Aa.text-4xl, .text-scale-6 |
font-size: var(--scale-6) !important |
Aa.text-5xl, .text-scale-7 |
font-size: var(--scale-7) !important |
Aa.text-6xl, .text-scale-8 |
font-size: var(--scale-8) !important |
Typography: Weight
Font weights, from the --font-weight-* tokens (Typography).
| Class | Declares |
|---|---|
Aa.font-bold |
font-weight: var(--font-weight-bold) !important |
Aa.font-header |
font-family: var(--font-header) !important |
Aa.font-normal |
font-weight: var(--font-weight) !important |
Aa.font-light |
font-weight: 300 !important |
Typography: Line height
Compact and relaxed line heights (--line-height-compact, --line-height-relaxed).
| Class | Declares |
|---|---|
.compact |
line-height: var(--line-height-compact) !important |
.relaxed |
line-height: var(--line-height-relaxed) !important |
Typography: Alignment
Text alignment.
| Class | Declares |
|---|---|
.text-left |
text-align: left !important |
.text-center |
text-align: center !important |
.text-right |
text-align: right !important |
.text-justify |
text-align: justify !important |
Typography: Transform
Case transforms.
| Class | Declares |
|---|---|
Aa.uppercase |
text-transform: uppercase !important |
Aa.lowercase |
text-transform: lowercase !important |
Aa.capitalize |
text-transform: capitalize !important |
Aa.text-transform-none |
text-transform: none !important |
Typography: Wrapping and overflow
Wrapping, text-box trim (optical alignment to the baseline grid) and truncation.
| Class | Declares |
|---|---|
.no-wrap |
white-space: nowrap !important |
.no-trim, .trim-none |
text-box-trim: none !important |
.trim-baseline |
text-box-edge: cap alphabetic !important |
.trim-cap |
text-box-edge: cap text !important |
.ellipsis, .ellipsis li |
overflow: hidden |
Colors: Text (semantic)
Text colour by role (.text-muted, .text-subtle, .text-accent read the colour roles: semantic tokens) and the font-family roles (.font-*).
| Class | Declares |
|---|---|
Aa.text-primary |
color: var(--color-foreground) !important |
Aa.text-muted, .muted |
color: var(--color-muted) !important |
Aa.text-subtle |
color: var(--color-subtle) !important |
Aa.text-accent |
color: var(--color-accent) !important |
Aa.font-text |
font-family: var(--font-text) !important |
Aa.font-monospace |
font-family: var(--font-monospace) !important |
Aa.font-serif |
font-family: var(--font-serif) !important |
Aa.font-sans |
font-family: var(--font-sans) !important |
Colors: Status
Text coloured by status: --color-success, --color-warning, --color-error, --color-info (Semantic tokens).
| Class | Declares |
|---|---|
Aa.success |
color: var(--color-success) !important |
Aa.warning |
color: var(--color-warning) !important |
Aa.error, .danger |
color: var(--color-error) !important |
Aa.info |
color: var(--color-info) !important |
Colors: Named spectrum (text)
Text coloured by hue, from --color-red to --color-pink (Semantic tokens).
| Class | Declares |
|---|---|
Aa.red |
color: var(--color-red) !important |
Aa.orange |
color: var(--color-orange) !important |
Aa.yellow |
color: var(--color-yellow) !important |
Aa.green |
color: var(--color-green) !important |
Aa.cyan |
color: var(--color-cyan) !important |
Aa.blue |
color: var(--color-blue) !important |
Aa.purple |
color: var(--color-purple) !important |
Aa.pink |
color: var(--color-pink) !important |
Backgrounds: Semantic
Backgrounds from the role and surface tokens (Surfaces and elevation), plus the translucent .bg-glass.
| Class | Declares |
|---|---|
.bg-background |
background-color: var(--color-background) !important |
.bg-surface |
background-color: var(--color-surface) !important |
.bg-accent |
background-color: var(--color-accent) !important |
.bg-foreground |
background-color: var(--color-foreground) !important |
.bg-transparent |
background-color: transparent !important |
.bg-glass |
backdrop-filter: var(--filter-glass) |
.bg-surface-raised, .bg-surface-light-1 |
background-color: var(--color-surface-raised) !important |
.bg-surface-overlay, .bg-surface-light-2 |
background-color: var(--color-surface-overlay) !important |
.bg-surface-light-3 |
background-color: var(--color-surface-light-3) !important |
.bg-surface-sunken, .bg-surface-dark-1 |
background-color: var(--color-surface-sunken) !important |
.bg-surface-dark-2 |
background-color: var(--color-surface-dark-2) !important |
.bg-stage |
background-color: var(--color-stage) !important |
.bg-surface-dark-3 |
background-color: var(--color-surface-dark-3) !important |
Backgrounds: Named spectrum
Backgrounds from the hue palette (Semantic tokens).
| Class | Declares |
|---|---|
.bg-red |
background-color: var(--color-red) !important |
.bg-orange |
background-color: var(--color-orange) !important |
.bg-yellow |
background-color: var(--color-yellow) !important |
.bg-green |
background-color: var(--color-green) !important |
.bg-cyan |
background-color: var(--color-cyan) !important |
.bg-blue |
background-color: var(--color-blue) !important |
.bg-purple |
background-color: var(--color-purple) !important |
.bg-pink |
background-color: var(--color-pink) !important |
Invert
.invert flips a subtree to the opposite colour scheme.
| Class | Declares |
|---|---|
.invert |
color: light-dark(var(--color-background), var(--color-foreground)) !important |
Shadows
Elevation as classes: each sets box-shadow to the matching --shadow-* token (Shadows and elevation). They are !important, so a utility wins over a component’s own shadow.
| Class | Declares |
|---|---|
.shadow |
box-shadow: var(--shadow) !important |
.shadow-raised |
box-shadow: var(--shadow-raised) !important |
.shadow-inset |
box-shadow: var(--shadow-inset) !important |
.shadow-xs |
box-shadow: var(--shadow-xs) !important |
.shadow-sm |
box-shadow: var(--shadow-sm) !important |
.shadow-md |
box-shadow: var(--shadow-md) !important |
.shadow-lg |
box-shadow: var(--shadow-lg) !important |
.shadow-xl |
box-shadow: var(--shadow-xl) !important |
.shadow-glow |
box-shadow: var(--shadow-glow) !important |
.shadow-ring |
box-shadow: var(--shadow-ring) !important |
.shadow-inset-ring |
box-shadow: var(--shadow-inset), var(--shadow-ring) !important |
.no-shadow |
box-shadow: none !important |
Borders
Border strokes (--border, --border-accent) and single sides.
| Class | Declares |
|---|---|
.border-0 |
border: 0 !important |
.border |
border: var(--border) !important |
.border-accent |
border: var(--border-accent) !important |
.border-t |
border-top: var(--border) !important |
.border-b |
border-bottom: var(--border) !important |
.border-l |
border-left: var(--border) !important |
.border-r |
border-right: var(--border) !important |
Border radius
Corners from --radius-sm, --radius and --radius-lg, and the fully round (Stroke, radius and filters).
| Class | Declares |
|---|---|
.rounded-sm |
border-radius: var(--radius-sm) !important |
.rounded |
border-radius: var(--radius) !important |
.rounded-lg |
border-radius: calc(var(--radius) * 1.5) !important |
.rounded-xl |
border-radius: calc(var(--radius) * 2) !important |
.rounded-full |
border-radius: 9999px !important |
.rounded-50, .rounded-50 img |
border-radius: 50% |
.no-rounded |
border-radius: 0 !important |
Multi-column flow
CSS multi-column flow for long lists and text: column counts, gaps, rules, and keeping an item whole.
| Class | Declares |
|---|---|
.columns, .columns-2 |
columns: 2 |
.columns-3 |
columns: 3 |
.columns-4 |
columns: 4 |
.columns-auto |
columns: auto |
.columns-gap-compact |
column-gap: var(--leading) |
.columns-gap-wide |
column-gap: var(--space-2) |
.columns-keep |
break-inside: avoid |
.columns-rule |
column-rule: var(--border) |
.columns-rule-accent |
column-rule: 1px solid var(--color-accent) |
.columns-2, .columns-3, .columns-4 |
columns: 1 |
.columns-3, .columns-4 |
columns: 2 |
Accessibility and resets
Visually hidden text for screen readers, removing decoration or bullets, and hyphenation and wrapping resets.
| Class | Declares |
|---|---|
.visually-hidden |
position: absolute |
.no-decoration, .no-decoration * |
text-decoration: none !important |
.no-mouse |
pointer-events: none |
.no-bullet |
list-style: none |
.keep-words |
word-break: keep-all |
.no-hyphen |
hyphens: none |
Spacing: Gaps
.gap-compact: a gap of --trim, the compact step of the baseline.
| Class | Declares |
|---|---|
.gap-compact |
gap: var(--gap-compact) !important |
Responsive breakpoints
Classes that apply at one breakpoint: the sm:, md: and lg: prefixes, and .only helpers that show an element at a single size (Breakpoints).
| Class | Declares |
|---|---|
.sm\:hidden |
display: none !important |
.sm\:only |
display: inherit !important |
.md\:only |
display: none !important |
.lg\:only |
display: none !important |
.sm\:text-center |
text-align: center !important |
.md\:hidden |
display: none !important |
.sm\:only |
display: none !important |
.md\:only |
display: inherit !important |
.lg\:only |
display: none !important |
.lg\:hidden |
display: none !important |
.sm\:only |
display: none !important |
.md\:only |
display: none !important |
.lg\:only |
display: inherit !important |