Foundations
Colour palette, type scale, and how theming works.
Tokens map to Tailwind utilities via @theme
(--color-grass → var(--c-grass)),
so bg-grass / text-fg /
border-line resolve through a live
var(). Hex below is read live from the
current theme. grass, ice, mesa, stone and gold
are shared across themes; the neutrals plus
grass-hi / wood
shift between dark and light.
bg
#…bg-bgPage background (behind the checker)
surface
#…bg-surfaceHeader, sidebar, wells
surface-2
#…bg-surface-2Insets, inputs, code
card
#…bg-cardCards & panels
fg
#…text-fgPrimary text / headings
body
#…text-bodyProse body copy
muted
#…text-mutedSecondary / captions
faint
#…text-faintFaintest text
line
#…border-lineAll chunky borders
divider
#…border-dividerSoft heading underline
rowline
#…border-rowlineTable / infobox rows
grass
#…bg-grassPrimary action / brand
grass-hi
#…text-grass-hiLinks, active state
gold
#…text-goldFeatured / season badge
wood
#…bg-woodPanel banners
wood-l
#…text-wood-lLabels on dark panels
ice
#…text-iceIce biome accent
mesa
#…text-mesaMesa biome accent
stone
#…text-stoneStone / neutral accent
Two families: Silkscreen (pixel) for
every heading, label and button, and Nunito
Sans for body copy. Base font size is 17px on
<html>.
Headings, badges, buttons, section labels. Runs large - size it down per use.
The quick brown fox builds a redstone farm at spawn.
| Role | Class | Size | Sample |
|---|---|---|---|
| Page title | .pixel | 26-30px | Spawn |
| Section heading | .section-h / prose h2 | 17px | Features |
| Sub heading | prose h3 | 14px | Design |
| Micro-label | .pixel-label | 10px | Navigate |
| Badge / tag | .mc-badge | 8px | Featured |
| Button | .mc-btn | 10px | Explore |
| Body copy | .prose | 16.5px / 1.75 | Built over many months. |
- One palette, three
--c-*blocks inmain.css::root/[data-theme="dark"](default),[data-theme="light"], and aprefers-color-scheme: lightblock for visitors who haven't chosen. @themekeeps thevar()reference in generated utilities, so flippingdata-themere-themes live.- The toggle writes
localStorage('slab-theme'); a pre-paint script inbaseof.htmlapplies it before first paint to avoid a flash.
- Never hardcode hex in templates -
use
bg-*/text-*/border-*so both themes stay in sync. To retune a colour, edit all three--c-*blocks. - Hard corners only - no
rounded. - Hard offset shadows, never blur. Depth
scale:
mc-card4px →mc-panel8px →mc-frame12px. - Chunky
border-lineborders (2 / 3 / 4px); stepped hover transitions (steps(2));image-rendering: pixelatedon sprites, maps and images.
Define it in the @layer components block of
main.css, compose with
@apply + tokens (not raw hex), keep the
mc-/feature-prefix naming, then run
npm run css to rebuild
app.css. Because
@source "../../layouts" scans the templates,
any utilities you use are picked up automatically.