Components
Button
Text actions. Default is the Brand-tint secondary; --primary fills with Brand; --ghost is a text link; --sm is the compact size.
Live example
Rendered with the real classes from /site/chitransit.css, light (left) and dark (right).
.ct-button.ct-button--primary.ct-button--ghost.ct-button--sm[disabled]Code
<button class="ct-button">Track</button>
<button class="ct-button ct-button--primary">Save</button>
<button class="ct-button ct-button--ghost">Show all</button>
<button class="ct-button ct-button--sm">Export</button>
<button class="ct-button" disabled>Disabled</button>
Tokens
From tokens/components.tokens.json. Override one instance by setting the property without the ct- prefix.
| Custom property | Value | Alias |
|---|---|---|
--ct-button-background | var(--accent-tint) | {colors.accentTint} |
--ct-button-background-primary | var(--accent) | {colors.accent} |
--ct-button-color | var(--accent) | {colors.accent} |
--ct-button-color-disabled | var(--inactive) | {colors.inactive} |
--ct-button-color-primary | var(--accent-ink) | {colors.accentInk} |
--ct-button-font-size | var(--fs-body) | {type.body} |
--ct-button-font-size-sm | var(--fs-sub) | {type.sub} |
--ct-button-font-weight | var(--weight-semibold) | {weight.semibold} |
--ct-button-gap | var(--space-8) | {space.s8} |
--ct-button-height | var(--size-minimum-tap-target) | {size.minimumTapTarget} |
--ct-button-height-sm | 36px | |
--ct-button-icon-size | 18px | |
--ct-button-padding-x | 18px | |
--ct-button-padding-x-sm | var(--space-12) | {space.s12} |
--ct-button-radius | var(--r-card) | {radius.card} |
Usage
Do
- Use one
--primarybutton per surface, for its main action. - Use
--ghostfor low-emphasis actions such as “Show all”. - Write the label as a verb: “Save”, “Track”, “Export”.
Don't
- Don't put two primary buttons side by side.
- Don't use a button for navigation; use a link.
Accessibility
- Use a real
<button>; disable with thedisabledattribute, not a class. - Every button keeps a 44 × 44 hit area whatever its visual size.
- Focus shows the Brand focus ring from
:focus-visible.