Style guide

Everything here is drawn from site/src/styles/tokens.css and global.css. Change a value in tokens.css and this page and the whole site follow. The rules and the reasons behind them are in TOFUBI/STYLE.md.

Rules

  • Every colour is a token Components use var(--color-…) from tokens.css, never a hex. A see-through version is color-mix(in srgb, var(--token) 40%, transparent).
  • Each colour has one job Indigo for surfaces, amethyst only for gems, fire only for the streak, green for progress, lemon only for things you press.
  • Solid fills, no gradients Bars, buttons, chips and banners are one colour. Depth comes from the solid edge underneath.
  • Progress is green Every progress bar and ring fills with --color-progress on a dark track.
  • No full-width banners Notes and level intros are small tags beside what they are about.
  • Plain, short words A title, a picture and one line. No "!" captions on events.

Colours

Night

the page and every surface on it, darkest to lightest.

  • --color-deep #160f33 tracks, wells, the edge under blocks
  • --color-scrim #130c2e darkening over art and covers (mixed with transparent)
  • --color-page-low #1a1245 the bottom of the page
  • --color-well #1c1445 solid sunk fills on the header: search, the nav's quiet pills
  • --color-page #241a4f night
  • --color-page-top #2a1b6b the sky behind the header, lighter than the page
  • --color-surface #34287a cards, tiles in panels
  • --color-surface-raised #413394 panels, dialogs, quiet buttons
  • --color-line #4a3c9a outlines, empty slots
  • --color-backdrop color-mix(in srgb, var(--color-deep) 75%, transparent) behind dialogs

Text

white for reading, lilac for quieter lines.

  • --color-text #ffffff
  • --color-text-soft #efeaff big titles on art, chips
  • --color-muted #c9c1f0 second lines, labels
  • --color-dim #a99de6 the quietest: icons at rest, hints
  • --color-error-text #ffb3a6 "Couldn't reach the server" lines

Glass

see-through fills and glows on the night sky.

  • --color-glass rgb(255 255 255 / 0.09)
  • --color-glass-line rgb(255 255 255 / 0.14)
  • --color-glow-pink rgb(255 95 184 / 0.42)
  • --color-glow-sky rgb(77 212 255 / 0.26)
  • --color-pink #ff5fb8 the banner's pink, the wardrobe's worn ring

Actions

lemon only for things you press (Play, Random, Sign in, links).

  • --color-accent #ffd84d
  • --color-accent-edge #c9a21f
  • --color-on-accent #241a4f text on lemon

Status

  • --color-progress #5aff49 every progress bar and ring, on a dark track. The green of Here's the Catch's quest bars
  • --color-online #4ee38a the "players online" dot
  • --color-alert #ff3b5c the red "something new" dot, and the HOT tag
  • --color-alert-edge #a3203b

Gems

amethyst only where something is gems (GemButton, reward chips, store prices).

  • --color-gem #8a5ce6
  • --color-gem-deep #5b2bb0
  • --color-gem-ink #2a1466
  • --color-gem-light #e6d8ff

Streak

fire only for the streak (StreakButton).

  • --color-fire #ff9a3c
  • --color-fire-edge #b8540f
  • --color-fire-ink #3a1a08

Candy

game tiles (lib/thumb-colors.ts) and the odd fun fill. Each has an edge for the solid shadow under it.

  • --color-on-candy #241a4f text on any candy
  • --candy-pink #ff8fc7
  • --candy-pink-edge #c9568f
  • --candy-sky #4dd4ff
  • --candy-sky-edge #1e93b8
  • --candy-mint #7cf29a
  • --candy-mint-edge #3bae5c
  • --candy-sun #ffb84d
  • --candy-sun-edge #c27f1c
  • --candy-grape #b794ff
  • --candy-grape-edge #7a56c9
  • --candy-coral #ff8c6b
  • --candy-coral-edge #c4583a
  • --candy-lemon #ffe66b
  • --candy-lemon-edge #bfa42a

Type

Fredoka 700 · Big numbers 345

Page title, 28 px

Panel title, 24 px

Section label, 13 px caps

Nunito for reading. Second lines are muted lilac, and the quietest hints are dim.

A muted line

Shape

--radius-sm --radius-md --radius-lg --radius-pill --edge

Building blocks

Buttons

Chips and tags

Puzzle Racing Idle New 30

Progress

2 of 3 minutes

Panel

Earn today

Play 3 minutes2 of 3 minutes 30

Bigger pieces keep their own styles in their component (GemButton, StreakButton, GameCard, HomeHero), built from these tokens.

Sign in or create an account

New to Tofubi? Enter your email and we'll set you up: there's no separate sign-up. An account lets you post to the leaderboards and comment. Playing never needs one.