Quaff

CSS Helpers

Compose layouts and common styles with shared classes.

Shared styles

Layout, spacing, and color.

Usage

Layout

Quaff follows Material 3 first. Familiar names ease migration, but the grid, breakpoints, typography, and colors keep Quaff's M3 behavior. Layout helpers use CSS layers rather than !important, so your app styles can override them.

flex creates a wrapping flex container; column creates a vertical one without wrapping. Combine flex column for a wrapping column. Add no-wrap to prevent wrapping, inline for inline flex, or reverse to reverse direction. row remains a 12-column CSS grid.

<div class="flex no-wrap items-center q-gap-md">
  <div class="min-width-0">Content</div>
  <button>Action</button>
</div>
Sizing
full-width, full-height, fit

Fill the parent's width, height, or both. Margins stay unchanged.

Shrinking
min-width-0, min-height-0

Let flex or grid children shrink below their content size.

Wrapping
wrap, no-wrap, reverse-wrap

Control flex wrapping.

Alignment
items-*, justify-*, self-*, content-*

Align children, individual items, or wrapped lines.

Order
order-first, order-last, order-none

Change visual order; reading and keyboard order stay unchanged.

Display
block, inline-block, hidden, invisible

Set display, remove an element, or hide it while keeping its space.

Scrolling
scroll, overflow-auto, scroll-x, scroll-y

Scroll only when content exceeds the available space.

Clipping
overflow-hidden, overflow-hidden-y, no-scroll

Clip overflow on both axes or just vertically.

Truncation
ellipsis, ellipsis-2-lines, ellipsis-3-lines

Shorten overflowing text to one, two, or three lines.

Position
relative-position, absolute, fixed

Set positioning; add -full, -center, an edge, or a corner.

Interaction
non-selectable, no-pointer-events, all-pointer-events, cursor-*

Control selection, pointer events, and the cursor.

Resets
no-margin, no-padding, no-border, no-border-radius, no-box-shadow, no-transition

Clear one style. border-radius-inherit follows the parent's corners.

Alignment suffixes are start/center/end. items-* and self-* also support baseline/stretch; justify-* adds between/around/evenly, and content-* adds stretch/between/around. Cursor suffixes are pointer/not-allowed/inherit/none.

Spacing

Use q-p* for padding and q-m* for margins. Directions are t/r/b/l for individual sides, x/y for both axes, and a for all sides.

Sizes are none/xs/sm/md/lg/xl: 0/4/8/16/24/48px. Margins also accept auto; padding and gaps do not. Use q-gap-* for both gaps, q-gap-x-* for column gaps, and q-gap-y-* for row gaps.

<div class="flex q-pa-md q-mx-auto q-gap-x-md q-gap-y-sm">
  ...
</div>
Colors and Text

Paired classes such as primary-container and surface-container-low set a background and its readable text color. bg-*, text-*, and border-* set just one color.

Surface roles include surface-dim, surface-bright, and surface-container, with -lowest/-low/-high/-highest variants. See colors and typography for palettes and text styles.

Responsive Visibility

Use xs/sm/md/lg/xl to show content at one size, or xs-hide/sm-hide/md-hide/lg-hide/xl-hide to hide it there. lt-md shows below medium; gt-sm shows above small. All use Quaff's M3 breakpoints. print-only and print-hide control print visibility.

<span class="lt-sm">Compact label</span>
<span class="gt-xs">Full label</span>

Using CSS pruning? Keep runtime-built names in your CSS safelist.