Components
List–detail split
Side-by-side panes that become swipeable steps on compact screens: .ct-split and .ct-pane.
List–detail panes in a .ct-view: fixed-width list panes and a detail pane that fills the rest. On compact screens each pane becomes a full-width step; selecting a row scrolls to its detail and a back bar returns.
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.
Code
<section class="ct-view ct-split" aria-label="Stations">
<div class="ct-pane ct-pane--list">
<div class="ct-pane-head">
<h2 class="ct-pane-title">Stations</h2>
<p class="ct-pane-sub">145 'L' stations</p>
<label class="ct-search">…</label>
</div>
<div class="ct-pane-body">…rows…</div>
</div>
<div class="ct-pane ct-pane--fill">
<div class="ct-pane-nav"><button class="ct-link-button ct-pane-back" type="button">‹ Stations</button></div>
<div class="ct-pane-body ct-pane-body--detail">
<div class="ct-page ct-page--reading">…</div>
</div>
</div>
</section>
Responsive behavior
| Viewport | Layout |
|---|---|
| > 900 wide | Panes side by side: --narrow 320, --list 380, --wide 440, --fill takes the rest; hairlines between them. |
| ≤ 900 wide or ≤ 500 tall | Every pane is full width; the split scrolls sideways, snapping one pane at a time. Detail panes show their .ct-pane-nav back bar. |
Tokens
From tokens/components.tokens.json. Override one instance by setting the property without the ct- prefix.
| Custom property | Value | Alias | Resolves to |
|---|---|---|---|
--ct-split-back-font-size | var(--fs-body) | {type.body} | 16 |
--ct-split-back-padding-x | var(--space-10) | {space.s10} | 10 pt |
--ct-split-body-padding-bottom | var(--space-32) | {space.s32} | 32 pt |
--ct-split-body-padding-top-detail | var(--space-20) | {space.s20} | 20 pt |
--ct-split-head-gap | var(--space-10) | {space.s10} | 10 pt |
--ct-split-head-padding-bottom | var(--space-12) | {space.s12} | 12 pt |
--ct-split-head-padding-top-compact | var(--space-12) | {space.s12} | 12 pt |
--ct-split-head-padding-top | var(--space-16) | {space.s16} | 16 pt |
--ct-split-nav-background | var(--paper) | {colors.paper} | #FFFFFF #0F141C |
--ct-split-nav-border | var(--line) | {colors.line} | #DADDE3 #263041 |
--ct-split-nav-height | var(--size-minimum-tap-target) | {size.minimumTapTarget} | 44 pt |
--ct-split-pane-background | var(--paper) | {colors.paper} | #FFFFFF #0F141C |
--ct-split-pane-border | var(--line) | {colors.line} | #DADDE3 #263041 |
--ct-split-pane-width-list | var(--size-pane-list) | {size.paneList} | 380 pt |
--ct-split-pane-width-narrow | var(--size-pane-narrow) | {size.paneNarrow} | 320 pt |
--ct-split-pane-width-wide | var(--size-pane-wide) | {size.paneWide} | 440 pt |
--ct-split-sub-color | var(--muted) | {colors.muted} | #5B6472 #B0BACA |
--ct-split-sub-font-size | var(--fs-sub) | {type.sub} | 13 |
--ct-split-title-font-size | var(--fs-title) | {type.title} | 20 |
--ct-split-title-font-weight | var(--weight-bold) | {weight.bold} | 700 |
--ct-split-title-gap | var(--space-10) | {space.s10} | 10 pt |
--ct-split-title-min-height | var(--size-minimum-tap-target) | {size.minimumTapTarget} | 44 pt |
Variants
A pane takes one width: .ct-pane--narrow (320), --list (380), --wide (440) or --fill (the rest). .ct-pane-body--detail adds space above a detail column. Nothing else exists.
<!-- Do -->
<section class="ct-view ct-split" aria-label="Stations">
<div class="ct-pane ct-pane--list">…</div>
<div class="ct-pane ct-pane--fill">…</div>
</section>
<!-- Don't: a split inside a split -->
<div class="ct-pane ct-pane--fill">
<div class="ct-split">…</div>
</div>
Usage
Do
- Scroll the detail pane into view when a row is selected on a compact screen, and back with the back bar.
- Put detail content in a
.ct-page--readingcolumn so lines stay readable on wide screens.
Don't
- Don't make swiping the only way back.
- Don't nest splits.
Accessibility
- Name each pane by its title; name the back bar by its destination.
- Move focus to the detail's heading when a row opens it on a compact screen.
- On compact screens set
inerton every pane scrolled out of view and clear it on the pane in view, so focus never lands off screen. No pane is inert on wide screens.
Contract
Contract: components/split.yaml. States are drawn live by transit.js.
Loading the contract…