Skip to content

Signal

Components

Page container

A centered content column: page, dashboard and reading widths, with optional page padding.

A centered content column for pages that scroll as a whole (the site intro), a dashboard (--dashboard, stacked with a gap) or a detail column (--reading). --padded adds the page's outer padding when it is not inside a pane.

Live example

The real classes from /site/chitransit.css in frames at phone, tablet and desktop widths, in the docs theme. The contract below shows each width in light and dark.

Phone · 390 × 760
Tablet · 768 × 900
Desktop · 1280 × 800

Code

<main class="ct-page ct-page--padded">…</main>
<div class="ct-pane-body"><div class="ct-page ct-page--dashboard">…</div></div>
<div class="ct-pane-body ct-pane-body--detail"><div class="ct-page ct-page--reading">…</div></div>

Responsive behavior

ViewportLayout
> 760 wideAt most 1040 wide (size.pageWidth), 980 for --dashboard, 600 for --reading. --padded: 40 above, 64 below, the gutter at the sides.
≤ 760 wide--padded: 24 above, 48 below, 16 at the sides or the side safe area if larger.

Tokens

From tokens/components.tokens.json. Override one instance by setting the property without the ct- prefix.

Custom propertyValueAliasResolves to
--ct-page-gap-dashboardvar(--space-20){space.s20}20 pt
--ct-page-padding-bottom-compactvar(--space-page-bottom-compact){spacing.pageBottomCompact}48 pt
--ct-page-padding-bottomvar(--space-page-bottom){spacing.pageBottom}64 pt
--ct-page-padding-top-compactvar(--space-page-top-compact){spacing.pageTopCompact}24 pt
--ct-page-padding-topvar(--space-page-top){spacing.pageTop}40 pt
--ct-page-padding-x-compactvar(--space-gutter-compact){spacing.gutterCompact}16 pt
--ct-page-padding-xvar(--gutter){spacing.gutter}20 pt
--ct-page-width-dashboardvar(--size-dashboard-width){size.dashboardWidth}980 pt
--ct-page-widthvar(--size-page-width){size.pageWidth}1040 pt
--ct-page-width-readingvar(--size-reading-width){size.readingWidth}600 pt

Variants

.ct-page is the default column, at most 1040 wide. --dashboard is 980 and stacks its children with a gap; --reading is 600, for text and detail. --padded adds the outer padding to any of them. Nothing else exists.

  • A page that scrolls as a whole (the site intro): the default, with --padded.
  • Metrics and cards: --dashboard.
  • Text or a detail column: --reading.
<!-- Do -->
<div class="ct-pane-body ct-pane-body--detail"><div class="ct-page ct-page--reading">…</div></div>
<!-- Don't: --padded inside a pane; the pane pads already -->
<div class="ct-pane-body"><div class="ct-page ct-page--padded">…</div></div>

Usage

Do

  • Use --reading for text and detail so lines stay readable.

Don't

  • Don't add --padded inside a pane; the pane pads already.

Accessibility

  • Put the page in <main> with one <h1>.

Contract

Contract: components/page.yaml. States are drawn live by transit.js.