Components
Chip
Small labels: route type, change type, metadata. Variants: --muted, --accent, --solid, --inverse, --outline, --good, --warn, --alert, --critical, --highlight; --sm is the changelog size.
Live example
Rendered with the real classes from /site/chitransit.css, light (left) and dark (right).
Train
.ct-chipBus
.ct-chip--mutedfeat
.ct-chip--accentrelease
.ct-chip--solidapi
.ct-chip--inverseapp
.ct-chip--outlineperffixbreaking
.ct-chip--good · --warn · --alertbreaking
.ct-chip--criticalComing soonNew
.ct-chip--highlightapifeatfixv1.4.0
.ct-chip--sma1b2c3
.ct-chip--monoCode
<span class="ct-chip">Train</span>
<span class="ct-chip ct-chip--muted">Bus</span>
<span class="ct-chip ct-chip--accent">feat</span>
<span class="ct-chip ct-chip--solid">release</span>
<span class="ct-chip ct-chip--inverse">api</span>
<span class="ct-chip ct-chip--outline">app</span>
<span class="ct-chip ct-chip--good">perf</span><span class="ct-chip ct-chip--warn">fix</span><span class="ct-chip ct-chip--alert">breaking</span>
<span class="ct-chip ct-chip--critical">breaking</span>
<span class="ct-chip ct-chip--highlight">Coming soon</span><span class="ct-chip ct-chip--sm ct-chip--highlight">New</span>
<span class="ct-chip ct-chip--sm ct-chip--inverse">api</span><span class="ct-chip ct-chip--sm ct-chip--accent">feat</span><span class="ct-chip ct-chip--sm ct-chip--warn">fix</span><span class="ct-chip ct-chip--sm ct-chip--solid">v1.4.0</span>
<span class="ct-chip ct-chip--sm ct-chip--muted ct-chip--mono">a1b2c3</span>
Tokens
From tokens/components.tokens.json. Override one instance by setting the property without the ct- prefix.
| Custom property | Value | Alias | Resolves to |
|---|---|---|---|
--ct-chip-background | var(--card-2) | {colors.card2} | #E9EBF1 #1F2733 |
--ct-chip-color | var(--ink) | {colors.ink} | #101A2E #EEF1F6 |
--ct-chip-font-size | var(--size-chip-text) | {size.chipText} | 12 pt |
--ct-chip-font-size-sm | var(--fs-cap) | {type.cap} | 12 |
--ct-chip-font-weight | var(--weight-semibold) | {weight.semibold} | 600 |
--ct-chip-font-weight-sm | var(--weight-semibold) | {weight.semibold} | 600 |
--ct-chip-height | var(--size-chip-height) | {size.chipHeight} | 22 pt |
--ct-chip-height-sm | var(--size-chip-height-small) | {size.chipHeightSmall} | 20 pt |
--ct-chip-outline-width | var(--size-focus-ring-width) | {size.focusRingWidth} | 2.5 pt |
--ct-chip-outline-width-sm | 1.5px | ||
--ct-chip-padding-x | var(--space-8) | {space.s8} | 8 pt |
--ct-chip-padding-x-sm | 7px | ||
--ct-chip-radius | var(--radius-chip) | {radius.chip} | 6 pt |
--ct-chip-tracking-sm | .02em |
Variants
Color: --muted, --accent, --solid, --inverse, --outline, --good, --warn, --alert, --critical, --highlight; with none, the chip is the Card 2 default. Size --sm (the changelog badge); --mono for codes. Nothing else exists.
- A status word:
--good,--warnor--alert;--criticalonly for an outage. - New or coming soon:
--highlight. - A neutral label (route type, metadata): the default or
--muted. - Emphasis on a busy surface:
--solidor--inverse.
<!-- Do -->
<span class="ct-chip ct-chip--good">On time</span>
<!-- Don't: a raw color, or a variant that doesn't exist -->
<span class="ct-chip" style="background:#2ec4b6">New</span>
<span class="ct-chip ct-chip--success">On time</span>
Usage
Do
- Use chips for small metadata labels: route type, change type.
- Pick a variant for emphasis:
--muted,--accent,--solid,--inverse,--outline. - Use
--smfor dense lists such as the changelog (repository, change type, release, breaking);--criticalmarks a breaking change. - Use
--highlightto call out information such as a new or coming-soon feature. - Use
--mutedfor a type pill (Station, Route, Stop) beside a search result.
Don't
- Don't use a status variant (
--good,--warn,--alert) without a status word. - Don't use
--highlightfor a status or a line; it only calls out information. - Don't use line colors on chips; line color means a line.
Accessibility
- Chips are static text. Interactive filters use the route toggle or segmented control.