Skip to main content
PimentCSS v1.0.1, what's new
Home

Layout

Container, 12-column grid, spacing utilities, and RGAA-friendly layout patterns for light and dark mode.

Overview

PimentCSS layout is intentionally small: a centered container, a flex-based 12-column grid, spacing utilities mapped to --space-* tokens, and a handful of display helpers. Import via the full bundle or pimentcss-design-system/core when you only need tokens + layout.

LayerLocationPurpose
Spacing tokenstokens/layout.css--space-1--space-7, radii, borders
Container & gridscss/layout/.container, .row, .col-*
Utilitiesscss/utilities/Spacing, display/flex, shadows
Copy width.copy-blockMax width 33rem for comfortable line length

Prerequisites

  • PimentCSS installed, Installation (layout ships with the default CSS).
  • Semantic colors, surfaces and text from Colors for readable UI inside columns.
  • Typography, heading/body utilities from Typography inside grid regions.

Spacing & layout tokens

Canonical spacing lives in tokens/layout.css. Override Sass variables before @use "pimentcss-design-system", see Customization.

Container

.container centers content, applies horizontal padding ($grid-gutter), and caps width at 75rem. Use .container--fluid for full-bleed sections while keeping gutter padding.

.container, max-width 75rem

12-column grid

Rows use flexbox with wrap. Columns are width fractions of 12 (.col-1.col-12). Gutters come from horizontal padding on columns (half gutter each side).

.col-12
.col-8
.col-4

Responsive columns

From 48rem (min-width), .col-md-* classes apply. Below the breakpoint, stack with .col-12 so mobile users get a single column without horizontal scroll.

.col-12 .col-md-4
.col-12 .col-md-4
.col-12 .col-md-4

Spacing utilities

Margin, padding, and gap helpers map to the spacing scale (0–6). Prefer gap-* in flex/grid layouts instead of chaining margins.

Visual scale only, class names follow the token number (.mt-3, .mb-4, .p-3, .gap-4).

Class patternMaps to
.m-0.m-6margin (all sides)
.mt-* · .mb-*margin top / bottom
.p-0.p-6padding (all sides)
.gap-0.gap-6flex/grid gap

Display & flex helpers

Utility classes for common flex layouts and visibility. Combine with spacing utilities; avoid inline styles in production when a utility exists.

ClassEffect
.d-flex · .d-inline-flexFlex formatting context
.d-block · .d-noneBlock / hide (d-none removes from layout, use for panels, not icons alone)
.flex-columnVertical stack
.align-center · .justify-betweenAlign / distribute on cross/main axis
.text-centerCenter text (not a substitute for page headings hierarchy)

Readable line length

Long prose should stay within 33rem (~66 characters). Use the .copy-block component or max-width: 33rem in your own styles.

Release notes

The copy block limits line length for comfortable reading in both light and dark themes.

Page shell pattern

Typical app shell: container → header row → main + aside. Use real landmarks (<header>, <main>, <aside>) so screen readers follow the same order as the visual grid.

Antilles Hub

Shipments

Container + grid keep reading order logical: header, then main column, then aside.

Quick integration

  1. Wrap the page

    Place primary content in .container. Add container--fluid only for hero bands or full-width data tables.
    <main class="container">…</main>
  2. Split columns

    Use .row and column classes. On small screens, start with .col-12 and add .col-md-* for tablet/desktop.
    <div class="row">
      <div class="col-12 col-md-8">…</div>
      <div class="col-12 col-md-4">…</div>
    </div>
  3. Space components

    Prefer gap-* inside toolbars and card footers. Use semantic text colors inside each column.
    <div class="d-flex gap-3 align-center"><button class="btn btn--primary">OK</button></div>

Class reference

ClassDescription
.containerCentered max-width shell + horizontal padding
.container--fluidFull width with gutter padding
.rowFlex row with negative gutter margin
.col-1.col-12Column width (12-column fraction)
.col-md-1.col-md-12Column width from 48rem viewport
.m-* · .mt-* · .mb-*Margin utilities (0–6)
.p-* · .gap-*Padding and flex gap utilities
.d-flex · .flex-column · …Display / flex / alignment helpers
.copy-blockConstrained prose width (33rem)
.shadow-xs.shadow-xlElevation shadows, see Depth & shadows

Sass customization

Accessibility

Layout & RGAA

  • Reading order, DOM order must match visual order; do not rearrange columns only with CSS order without testing with a screen reader.
  • Reflow, stack columns on small viewports (.col-12); avoid horizontal scroll for text (WCAG 1.4.10).
  • Contrast, text inside columns uses --text-body on --surface-page / --surface-elevated (validated on Colors).
  • Touch targets, keep actions in grid cells at least 44×44px (--min-touch-target), see Buttons.
  • Zoom, spacing uses rem; layout must remain usable at 200% zoom.

Next steps