Utility Classes Reference

Companion to Styling with Variables. That doc covers the token system; this one catalogues the ~500 single-purpose classes built on top of it, living in @layer utilities and @layer utilities-advanced.

How to read this page: classes are grouped by naming pattern rather than listed one-by-one where a pattern repeats across a numeric scale (e.g. .p-t-1.p-t-4). Where a class reads a token, the token is named — override the token instead of overriding the class.


1. Spacing (margin & padding)

Two independent numeric scales are used throughout, and the naming tells you which one applies:

  • 04 suffix on shorthand classes (.m1.m4, .p1.p4) → dense scale, --space-dense-1--space-dense-4
  • 04 suffix on directional classes (.m-t-1.m-t-4, .p-b-1.p-b-4, etc.) → regular scale, --space-1--space-4
  • Fixed fractional suffixes (-1-16, -1-8, -1-4, -1-2, -3-4) → fixed rem values that don't scale with viewport (0.0625rem → 0.75rem), for fine adjustments rather than rhythm
ClassesSetsSource
.m0.m4 / .p0.p4margin / padding, all sides--space-dense-14
.m-t-04 / .p-t-04margin-top / padding-top--space-14
.m-b-04 / .p-b-04margin-bottom / padding-bottom--space-14
.m-l-04 / .p-l-04margin-left / padding-leftdense scale
.m-r-04 / .p-r-04margin-right / padding-rightdense scale
.m-h-04 / .p-h-04margin-inline / padding-inline (both sides at once)dense scale
.m-v-04 / .p-v-04margin-block / padding-block (top+bottom at once)dense scale
.m-1-16.m-3-4 / .p-1-16.p-3-4margin / padding, all sides, fixed remfixed values
.m-b--1-16.m-b--3-4 (and -l/-r/-t/-h/-v equivalents)directional margin/padding, fixed remfixed values
.m-auto / .m-h-auto / .m-v-automargin auto (centering)

Child & flow utilities (see also Flow tokens):

ClassesSetsSource
.flowmargin-top on every child after the first--page-flow
.flow-1.flow-4same, at a fixed step regardless of --page-flow--space-14
.child-paddingpadding on every direct child--child-padding
.child-padding-1.child-padding-4same, at a fixed step--space-14
.child-margin / .child-margin-24margin on every direct child, at a fixed step--space-14
.gap / .gap-2.gap-4flex/grid gap--default-gap / --space-24

2. Sizing

ClassesSetsNotes
.w-25 / .w-33 / .w-50 / .w-66 / .w-75 / .w-100width as a percentage
.w-25-vw.w-100-vw (+ -min variants)width in viewport units, or min-width equivalentsfor full-bleed or viewport-relative elements
.w-1rem.w-10remfixed width
.w--1rem.w--4remwidth: calc(100% - Nrem)the double-dash means "100% minus", not negative
.h-* / .h--*height equivalents of all the abovesame conventions
.mw-1rem.mw-10remmax-width
.mh-1rem.mh-10remmax-height

3. Layout — Flexbox & Grid

ClassesSets
.d-flex / .d-inline-flex / .d-grid / .d-inline-grid / .d-block / .d-inline / .d-inline-block / .d-none / .d-table / .d-table-cell / .d-table-rowdisplay
.flex-row / .flex-row-reverse / .flex-column / .flex-column-reverseflex-direction
.flex-wrap / .flex-nowrap / .flex-wrap-reverseflex-wrap
.flex-fill / .flex-grow-0 / .flex-grow-1 / .flex-shrink-0 / .flex-shrink-1flex sizing
.justify-content-startend/center/between/aroundjustify-content
.align-items-startend/center/baseline/stretchalign-items
.align-content-startend/center/between/around/stretchalign-content
.align-self-autoend/center/baseline/stretchalign-self
.grid-cols-1/2/3/4/6/12grid-template-columns (equal-width tracks)
.col-span-1/2/3/4/6/fullgrid-column: span N
.clusterflex row, wrapped, centered — quick horizontal grouping

4. Position & offsets

ClassesSets
.position-static / .position-relative / .position-absolute / .position-fixed / .position-stickyposition
.top-04 / .bottom-04 / .left-04 / .right-04offsets, fixed rem steps
.top-25/50/75 / .right-25/50/75offsets, percentage
.top-25-vh/50-vh/75-vh / .right-25-vw/50-vw/75-vwoffsets, viewport units
.z--1 / .z-0 / .z-1.z-3 / .z-10 / .z-100ad-hoc z-index steps — for anything not already covered by --z-floating/--z-overlay/--z-modal (see Structural tokens)

5. Borders & radius

ClassesSetsNotes
.border / .border-0/2/4/8all-side border, width stepsuses --grey by default
.border-t/-b/-l/-r/-h/-v (+ -0/2/4/8 width steps)directional borders-h = left+right, -v = top+bottom
.border-solid / .border-dashed / .border-dotted / .border-double / .border-noneborder-style
.border-color-1/2 / .border-danger/info/success/warning/dark/grey/light-grey/luxury/black/whiteborder color, all sidestoken-driven
.border-a-color-1.border-a-whitesame palette, explicit "all sides" variant
.border-gradient / .border-gradient-info/success/danger/warning/luxury/black/whitegradient border (--color-1 → named color)uses border-image, so it overrides border-style
.rounded / .rounded-0 / .rounded-1-4 / .rounded-1-8border-radius, from none to a fixed rem stepindependent of --default-border-radius — use this when you need a radius that doesn't follow the panel/control radius
.rounded-t/-b/-l/-r (+ -1-4/-1-8)radius on two corners onlyfor tab-style or attached-edge shapes
.circle / .circle-t/-b/-l/-rborder-radius: 50%, or half-pill on one side

6. Color, background & gradients

ClassesSetsNotes
.color-1 / .color-2 / .danger / .info / .success / .warning / .dark / .grey / .light-grey / .luxury / .black / .whitetext colordirect token read, no mixing
.bg-color-1/2 / .bg-danger/info/success/warning/dark/grey/light-grey/luxury/black/white/body-bgsolid background-color
.bga-color-1/2 / .bga-danger/info/success/warning/dark/grey/luxurytinted background + matching text color, via color-mix() at 10%the "soft badge" pattern — use this instead of a solid .bg-* when you want a subtle tint, not a solid fill
.bg-gradient / .bg-gradient-info/success/danger/warning/luxury/black/whitelinear-gradient background, --color-1 → named color
.color-gradient / .color-gradient-hovergradient applied to text (via background-clip)
.outline-color-1/2 / .outline-color-danger/info/success/grey/dark/black/white / .outline-light-grey / .outline-warning / .outline-luxuryoutline-colordistinct from the automatic focus-visible ring in @layer overrides — use these for a deliberate, always-on outline, not a focus state

Convention to hold onto: .bg-* is a flat fill; .bga-* is a tint (10% color-mix()) with color already paired to it. Reach for .bga-* for badges, callouts, and soft highlights — reach for .bg-* for solid blocks and section backgrounds.


7. Shadows

ClassesSets
.shadow / .shadow-hover (hover variant)--control-shadow-style dual shadow
.shadow-1/-1-hoverfixed dual-layer shadow (no border)
.shadow-2/-2-hoverbordered + hard offset shadow
.shadow-3/-3-hoverbordered + soft diffuse shadow
.shadow-4/-4-hover / .hover-shadowlarge, dramatic elevation shadow
.shadow-color.shadow-color-4/-hover variantssame four levels, tinted with --color-1 via color-mix() instead of black
.shadow-none/-hoverremoves shadow

All shadow utilities sit in @layer utilities-advanced, after components — this is what lets .shadow-4 override a card's own --panel-shadow-driven shadow without !important.


8. Typography utilities

ClassesSets
.bold / .font-weight-200/400/600 (aliases: .font-thin/.font-regular/.font-semibold)font-weight
.italic / .underline / .decoration-none / .old-info (strikethrough)font-style / text-decoration
.text-uppercase / .text-lowercase / .text-capitalizetext-transform
.double (200%) / .large (150%) / .larger (125%) / .small (75%) / .smaller (85%) / .half (50%)relative font-size steps
.letter-spacing-05letter-spacing, 0 to 0.6rem
.line-height-1 / .line-height-17 (1.7) / .line-height-2line-height
.height-1lines / .height-2lines / .height-3linesmulti-line clamp/truncation to N lines
.justified / .left / .right / .centertext-align
.hover-grey / .hover-white / .hover-underlinehover-only color/decoration changes for text
.unselectableuser-select: none
.word-wrap-breakforces long unbreakable strings (URLs, etc.) to wrap

9. Effects, overflow & visibility

ClassesSets
.brightness-33/66/80/90/100/150 (+ -hover variants)filter: brightness()
.overflow-hidden / .overflow-visible / .overflow-x-* / .overflow-y-*overflow
.clear-fix / .overflow-autoclassic clearfix via overflow: auto
.scrollbar-none / .scrollbar-thinscrollbar-width
.float-left / .float-right / .float-none / .clear-both / .clear-left / .clear-rightfloat layout (legacy pattern, prefer flex/grid utilities above)
.desktop-only / .mobile-onlyresponsive display toggle at the 992px breakpoint
.sr-onlyvisually hidden, still announced to screen readers
.skip-linkkeyboard-focus-revealed "skip to content" link, styled from --control-* tokens
.opacity1/07/05/03 (+ -hover variants)opacity steps

10. Rule of thumb for this page

If you're stacking more than two or three utility classes on the same element to achieve one repeatable look (a badge, a callout, a card variant), that's the signal to stop and either:

  1. check whether a component or theme preset already covers it, or
  2. propose a new one-line modifier class in utilities-advanced that sets the underlying tokens (the .glass pattern from Composition over duplication) rather than continuing to hand-compose utilities in markup.
← Previous Next →
{C}

Built with love by Kim Majali, EITO team, and contributors.