← slabserver.org SlabServer wiki logo SlabServer Community wiki
Style guide

Foundations

Colour palette, type scale, and how theming works.

Palette

Tokens map to Tailwind utilities via @theme (--color-grassvar(--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.

Surfaces & ink
bg #…
bg-bg

Page background (behind the checker)

surface #…
bg-surface

Header, sidebar, wells

surface-2 #…
bg-surface-2

Insets, inputs, code

card #…
bg-card

Cards & panels

Aa
fg #…
text-fg

Primary text / headings

Aa
body #…
text-body

Prose body copy

Aa
muted #…
text-muted

Secondary / captions

Aa
faint #…
text-faint

Faintest text

Aa
line #…
border-line

All chunky borders

Aa
divider #…
border-divider

Soft heading underline

Aa
rowline #…
border-rowline

Table / infobox rows

Accents & biomes
grass #…
bg-grass

Primary action / brand

Aa
grass-hi #…
text-grass-hi

Links, active state

Aa
gold #…
text-gold

Featured / season badge

wood #…
bg-wood

Panel banners

Aa
wood-l #…
text-wood-l

Labels on dark panels

Aa
ice #…
text-ice

Ice biome accent

Aa
mesa #…
text-mesa

Mesa biome accent

Aa
stone #…
text-stone

Stone / neutral accent

Typography

Two families: Silkscreen (pixel) for every heading, label and button, and Nunito Sans for body copy. Base font size is 17px on <html>.

Silkscreen · var(--font-pixel)
Aa Bb 123

Headings, badges, buttons, section labels. Runs large - size it down per use.

Nunito Sans · var(--font-sans)
Aa Bb 123

The quick brown fox builds a redstone farm at spawn.

RoleClassSizeSample
Page title.pixel26-30pxSpawn
Section heading.section-h / prose h217pxFeatures
Sub headingprose h314pxDesign
Micro-label.pixel-label10pxNavigate
Badge / tag.mc-badge8pxFeatured
Button.mc-btn10pxExplore
Body copy.prose16.5px / 1.75Built over many months.
Theming & Conventions
How theming works
  • One palette, three --c-* blocks in main.css: :root / [data-theme="dark"] (default), [data-theme="light"], and a prefers-color-scheme: light block for visitors who haven't chosen.
  • @theme keeps the var() reference in generated utilities, so flipping data-theme re-themes live.
  • The toggle writes localStorage('slab-theme'); a pre-paint script in baseof.html applies it before first paint to avoid a flash.
Do & don't
  • 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-card 4px → mc-panel 8px → mc-frame 12px.
  • Chunky border-line borders (2 / 3 / 4px); stepped hover transitions (steps(2)); image-rendering: pixelated on sprites, maps and images.
Adding a new component

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.