Skip to content

Signal

Components

Card

The gray card on white, the layout unit. --empty centers a muted message.

Live example

Rendered with the real classes from /site/chitransit.css, light (left) and dark (right).

Clark/Lake0.2 mi · 4 lines
.ct-card
No favorites yetStar a stop to keep it here.
.ct-card--empty

Code

<div class="ct-card"><b>Clark/Lake</b><span class="ct-color-muted ct-text-sub">0.2 mi · 4 lines</span></div>
<div class="ct-card ct-card--empty"><b>No favorites yet</b>Star a stop to keep it here.</div>

Tokens

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

Custom propertyValueAliasResolves to
--ct-card-backgroundvar(--card){colors.card}#EDEEF1 #1D232D
--ct-card-bordervar(--line){colors.line}#DADDE3 #263041
--ct-card-border-width1px
--ct-card-empty-colorvar(--muted){colors.muted}#5B6472 #B0BACA
--ct-card-empty-font-sizevar(--fs-sub){type.sub}13
--ct-card-empty-padding-xvar(--space-16){space.s16}16 pt
--ct-card-empty-padding-yvar(--space-20){space.s20}20 pt
--ct-card-framevar(--shadow-frame){shadows.frame}
--ct-card-gapvar(--space-8){space.s8}8 pt
--ct-card-paddingvar(--space-card-padding){spacing.cardPadding}14 pt
--ct-card-radiusvar(--r-card){radius.card}12 pt

Variants

.ct-card is the default: Card fill, no shadow. --empty centers one muted message; --hairline adds a 1px rule for a card on a card-colored surface. Nothing else exists.

  • Content: the default.
  • Nothing to show yet: --empty.
  • A card on a card-colored surface: --hairline.
<!-- Do -->
<div class="ct-card ct-card--empty"><b>No favorites yet</b>Star a stop to keep it here.</div>
<!-- Don't: a shadow, or a card inside a card -->
<div class="ct-card" style="box-shadow:0 2px 8px rgb(0 0 0 / .2)">
  <div class="ct-card">…</div>
</div>

Usage

Do

  • Use gray cards on white as the layout unit.
  • Use --empty for an empty state with one muted message.

Don't

  • Don't nest cards or add a shadow to a card; sheets and floating controls carry elevation.

Accessibility

  • A card is a container, not a control. If the whole card is tappable, make it a link or button with one accessible name.