Getting started
Install
Use Signal on the web, in a Swift package, or from the platform-neutral token files.
Web
The npm package @chitransit/signal is defined in package.json (it exports tokens.css, chitransit.css and icons/* from platforms/web/, registry GitHub Packages) but isn't published yet; that is CTA-212. Until it is, take the files from platforms/web/. Load chitransit.css before any page styles:
<link rel="stylesheet" href="/site/chitransit.css">
<link rel="stylesheet" href="/your-page.css">
The bundle puts tokens and the base in cascade layers, so any page rule overrides them, then adds the component and utility classes. For the transit components (route icons, markers, arrival cards) also load transit.css and transit.js; see Web.
iOS: Swift package
Add the repository as a package dependency pinned to a release tag, and depend on the Signal product:
.package(url: "https://github.com/chitransit/signal.git", exact: "<version>"),
// target dependencies:
.product(name: "Signal", package: "signal"),
import Signal
let ink = DesignTokens.colorValue(.ink) // light / dark hex
let gutter = DesignTokens.Spacing.gutter // 20 pt
DesignTokens holds every token as Swift constants; TransitIcon and the asset catalog (transit.train, transit.bus, transit.train-bus, template-rendered) provide the transit icons. The repository is private, so Xcode needs GitHub access to chitransit/signal. Pin a commit until the first release is tagged.
Android-compatible formats
No Android package yet. The formats stay Android-compatible: plain JSON tokens with explicit units and light/dark pairs, platform-neutral contracts, single-colour SVG icons that convert to VectorDrawables. See Android-compatible formats.