Tokens, components and charts for CrabPHP applications. It looks like the Crab site: one typeface, one size, a dark page, amber for what you can act on. Everything here is plain HTML and CSS; copy the markup under any example.
<link rel="stylesheet" href="css/crab.css">
Colour
Every colour is a token in tokens.css. White carries text at four strengths, amber marks what you can act on, and four status colours always sit beside a word.
Type and space
One family, one size, one line height, two weights. Vertical space is counted in lines and horizontal space in characters, so everything sits on the same grid.
Token
Value
Use
--font
The only typeface
--size
The only text size; 14px on phones
--lh
One line: the unit of vertical space
--half
half a line
Cell padding, gaps inside a component
--gap
Horizontal gap between related things
--gutter
Between columns
--measure
Reading column
--wide
Application content
--nav
Navigation column
--control
1.25 lines; 36px on touch screens
Height of an input or solid button
--touch
Tap area of a text button on touch screens
Text elements
Plain HTML needs no classes. Headings are uppercase and bold at body size, marked like Markdown.
A third-level heading
Body text at 88% white with a link in amber, strong text in full white, inline code, a highlight and a key such as CtrlK.
Lists use a dash
in faint white
Numbered steps
keep their numbers
A note has a thin amber rule on its left.
composer create-project crabphp/crab app
Buttons
A button is bracketed amber text. Use one .solid button for the main action of a view, .quiet for secondary actions and .danger for destructive ones.
Seven series colours in a fixed order, chosen so neighbours stay apart for colour-blind readers. Assign them in order and never reuse one for a different series. A one-hue ramp shows magnitude.
Line
Change over time. Hover or use the arrow keys to read a day; every chart also offers its numbers as a table.
Visitors last 30 daysEmail activity last 14 days
Columns
Amounts per period. Bars are thin and square, and stacked parts are separated by a gap, not an outline.
Emails sent per dayVisits by source per week
Ranking
Compare named things with a table and an inline .bar. The table already is the data, so nothing else is needed.
Page
Visitors
/
18,420
/docs/installation
11,790
/docs/routing
7,552
/benchmarks
4,051
/docs/queues
1,660
Heatmap
How much, across two dimensions: here, when mail arrives.
Messages received by weekday and hour, UTC
Segments
One whole split into a few parts. The legend names each part and its share.
Devices
Tabs
Visitors, pages and sources for the chosen range.
Custom events sent by your site.
Domain, timezone and the tracking script.
Breadcrumb
Pagination
Nav list
The column on the left of this page. The current item is amber and marked with >; a .count sits at the right.
Notes
A message in the page. Start with the word that says what it is.
Note. Reports use UTC unless the site sets a timezone.
Saved. Your changes are live.
Warning. This site has sent no data for 2 days.
Error. The message could not be sent: the recipient's server refused it. Try again
Toasts
A short confirmation that leaves on its own. Put a .toasts region at the end of the page and add each message to it.