SproutPixel-prop kit
A UI kit in which every control is a small physical prop: buttons are baked pieces, sliders are planks, headings are painted signs. Everything is drawn on a 3px pixel grid, and there is not one smooth curve in it.
Two things to hold on to. Everything is a whole number of units -
size, corner, edge, bevel, gap and every step of motion is an integer
multiple of --px, so the kit rescales by changing one value.
And pieces are objects, not paint: at night the ground goes dark
but a piece keeps its baked colour, dimmed as if lamplit. It never
inverts.
Read this first
- These values are the system. Every token below is declared in
css/sprout-core.css. Use them; do not invent parallel ones. - Search for an existing piece before building a second one. A new control is almost always an existing shell, face and bevel with a different label.
- Whole units only. Every size is
calc(n * var(--px))with a wholen. No raw hex, no half units, no one-off pixel sizes. - No
border-radius, anywhere. Corners areclip-pathstaircases. A single rounded corner breaks the illusion for the whole page. - Token names are roles.
--pieceis the face of a control, not "a beige". Read what a token is for before reaching for it. - Motion is
steps()only. Nothing eases, fades or blurs. If it moves, it jumps.
Colour
Twenty-two role tokens in six families. Every packet shows day on the
left and night on the right, so both themes are always in view.
Click a packet to copy its var().
Ground · the board
Piece · the raised face
Alt · the counter-piece
Ink · on pieces and sheets
Accent · the living signal
Disabled · an unbaked piece
Focus
Contrast floor · measured, day / night
| Pair | Day | Night | Rule |
|---|---|---|---|
| --ink on --piece | 5.0:1 | 5.9:1 | The standard text pair: every button label. |
| --ink on --piece-hi | 6.0:1 | 7.3:1 | Text on a sheet: panels, fields, packets. |
| --ink-soft on --piece-hi | 4.6:1 | 4.9:1 | Placeholders. Sheet face only - on --piece it would drop under 4.5. |
| --ground-ink on --ground | 6.1:1 | 13.0:1 | All small text on the board. |
| --ground-ink on --ground-inset | 5.0:1 | 14.1:1 | Captions and tables on a plate. |
| --glint on --alt | 7.0:1 | 4.9:1 | Labels on a secondary button. |
| --glint on --accent | 2.0:1 | 3.7:1 | Large display only. Sign text is 20px bold and up; small text never sits on green. |
| --alt on --ground | 4.1:1 | 3.2:1 | Tracks, dashes and the focus ring clear 3:1 against the board. |
| --focus on --piece-hi | 6.0:1 | 3.5:1 | The ring stays visible when it sits on a sheet. |
| --disabled-ink on --disabled | 2.3:1 | 2.7:1 | Deliberately faint. A disabled piece is exempt, and should look it. |
Why two inks
Text on a piece and text on the ground look like one colour by day, and
the kit could have used one token for both. It does not, because at
night they have to part ways: the ground goes dark and needs a light
ink, while the pieces stay lamplit and keep a dark one. --ink
and --ground-ink are the same idea on two different
surfaces, and naming them separately is what lets night exist without
a single exception in the component CSS.
The same reasoning split --alt from --ink: by
day both are one cocoa, but a track has to clear 3:1 against a dark
board and a lamplit sheet at once, and a text ink does not.
Typography
Two voices. A pixel face, always uppercase, for everything a prop would have painted on it; a plain system sans for anything a person has to read in sentences. Every size below is rendered at its real size.
Body copy is a plain system sans so paragraphs stay easy on the eyes;
the pixel voice is saved for labels and signs. On the ground, body
text takes --ground-ink; on a sheet it takes --ink.
Type tokens
| Token | Value | Face | Where |
|---|---|---|---|
| --fs-hero | 40px / 700 | --font-pixel | The big sign. One per page. |
| --fs-title | 30px / 700 | --font-pixel | The big sign on a phone; large figures. |
| --fs-heading | 20px / 700 | --font-pixel | Sign faces, the large button. |
| --fs-label | 15px | --font-pixel | Button labels, panel titles. |
| --fs-caption | 10px | --font-pixel | Captions, row labels, tooltips, check text. The floor. |
| --fs-body | 14px / 1.6 | --font-body | Running text and inputs. |
| --font-pixel | "Silkscreen", monospace | display | SIL Open Font License, loaded by URL. Uppercase always. |
| --font-body | system-ui stack | body | Nothing to download. |
| --font-code | ui-monospace stack | code | Token names in documentation. Never on a prop. |
Why the split is by length
The pixel face is paint on a prop. At label length it reads as something lettered onto the object; stretched across a paragraph it becomes tiring, because every glyph is a block of squares. So the rule is decided by length, not by importance: a label, a title, a caption goes pixel; anything a reader has to follow across more than a line goes to the body face, however important it is.
Display sizes are fixed px and run 10, 15, 20, 30, 40,
never a rem: a painted label is part of the piece it sits
on, and the piece is sized in units, not by the reader's text setting.
Space and layout
One unit, --px: 3px, and every distance is a whole multiple
of it. The scale is not a list of chosen sizes but the multiples the kit
actually uses, each with a job.
| Units | At 1x | Bar | Where |
|---|---|---|---|
| 1u | 3px | Every edge, every bevel, the pressed drop, the D-pad gap. | |
| 2u | 6px | Gap between a control's parts: dashes, stepper and rail, seed dots. | |
| 3u | 9px | Button face, vertical padding; checkbox to its label. | |
| 4u | 12px | Between an icon, a label and a toggle in a row. | |
| 5u | 15px | Button face, horizontal padding; sign face, horizontal padding. | |
| 6u | 18px | Plate and panel padding. | |
| 8u | 24px | Between specimens on a plate. | |
| 10u | 30px | Headroom above a sign, so the tendrils have somewhere to grow. | |
| 22u | 66px | Between sections. |
Measures and breakpoint
| Measure | Value | Note |
|---|---|---|
| page | 1120px | Content ceiling, centred on the board. |
| reading | 640px | Ledes and running text never run wider. |
| panel | 720px | The widest a sheet of prose gets. |
| gutter | 20px / 16px | Side margin; the second value applies under the breakpoint. |
| breakpoint | 720px | The one breakpoint. Below it the hero sign drops to --fs-title and plates tighten from 6u to 4u. |
Why one unit
Because it makes the whole kit scale as a single object. Set
--px: 6px on any wrapper and the geometry inside doubles -
corners, edges, bevels, gaps and sprites together - and still lands on
the grid. Only the painted labels hold their size, since type is set in
fixed pixels. A kit with a free-form spacing scale cannot do that: its
10px gap and its 3px edge would drift out of step the moment either
was scaled. The Form section below shows the same button at 1x and 2x.
Form
The silhouette is three layers. An outer layer in the edge colour, clipped to a staircase and padded by one unit; a face inside it, clipped to the same staircase; and a one-unit bevel on the face - light above, dark below. Press a piece and the bevel goes while the label drops exactly one unit.
Anatomy · one button at 1x and 2x, its corner at 4x
- edge · 1 unit
- top bevel · 1 unit
- face
- bottom bevel · 1 unit
Form values
| Part | Value | What it does |
|---|---|---|
| --c1 / --c2 | 1u / 2u | The standard staircase: the corner steps two units in, one unit per step. |
| .spr-clip-lg | 2u / 4u | The same two-step staircase at double stride, for plates, panels, the big sign and stages. |
| --clip-px | 20-point polygon | The staircase itself, driven by --c1 and --c2. Rescope those two to resize the corner. |
| edge | 1u | An outer element in --piece-edge with padding: var(--px). Not a border - a border cannot follow a staircase. |
| bevel | 1u + 1u | Two inset shadows on the face: --piece-hi above, --piece-lo below. Zero blur, always. |
| shade | 2u bottom | Signs and panels carry one extra unit of edge at the bottom: the object's weight. |
| pressed | bevel off, 1u down | The piece is pushed flat. Content moves, the outline does not. |
| border-radius | none | Not a small value. Absent. |
Why layers and not borders
A CSS border is drawn along the element's box and then cut by the clip-path, so at every stepped corner the border is sliced off and the outline opens. An outer layer clipped to the same staircase has no box edge to lose: the edge is simply the one unit of outer colour left showing around the face, and it follows every step. The same reason puts the focus ring on an unclipped wrapper - a clip-path would cut the ring away too.
Motion
Toy motion. Things jump between whole positions and never pass through the space between them. Flip the toggle and watch the knob hop; the tendrils on every sign sway one unit each way.
Motion values
| Token | Value | Where |
|---|---|---|
| press | 0s | Bevel off, content down 1u. No transition at all. |
| --t-hop | 0.2s steps(2) | The toggle knob: two jumps across ten units, never a slide. |
| --t-sway | 2.6s per hold | Tendrils: one unit left for 2.6s, one unit right for 2.6s, steps(1). The right tendril runs one hold behind the left. |
| tooltip | display swap | A hover tip appears whole. No fade, no rise. |
| reduced | prefers-reduced-motion | The sway stops and the knob jumps without its two steps. State changes stay instant, so nothing is lost. |
Why steps and not easing
An eased transition renders every in-between position, and on a kit
drawn in 3px squares the in-betweens land between squares - for a
frame or two the art is blurred. steps() only ever shows
positions on the grid, so the illusion holds while things move. The
sway is written as explicit holds rather than alternate
for a practical reason: a one-step timing played in reverse never
leaves its first frame, and an alternating sway silently stands still.
Screen
One optional surface treatment: a furrow field. The board resolves into whole cells in mown stripes, with a few tufts flicking on a slow tick. Move across the right-hand panel and rings of cells lift in a pixel diamond around the pointer, travelling outward one whole cell per tick.
Uniforms
| Uniform | Value | What it does |
|---|---|---|
| uCell | 12px (4u) | Cell size, rounded to whole device pixels. Every decision in the shader is made per cell, so nothing finer than a cell can appear. |
| uStep | 8 per second | The only clock: a whole tick count. Time in the shader never has a fraction. |
| uStripe | 4 cells | Width of a mown stripe - 16u, the same stripe the fallback draws in CSS. |
| uGap | 3 cells | Spacing between ripple rings. The front sits where distance minus tick is a multiple of the gap. |
| uReach | 10 cells | How far the rings run at full engagement. It grows and shrinks one whole ring at a time as the pointer enters and leaves. |
| uTuft | 0.045 | Share of cells carrying a tuft, each flicking on its own phase of an eight-tick cycle. |
| uGround, uInset, uAccent, uAccentLo, uGlint | tokens | Read from the live values and re-read on every theme change. The glint cell marks the pointer. |
| spring | k 58 / d 9 | The ripple's centre follows the pointer on a spring, then snaps to a whole cell - weight in the motion, no smear in the drawing. |
Why it cannot blend
The kit refuses gradients, and the shader makes that refusal structural rather than a matter of care. Each cell picks one of five token colours and never mixes two: there is no fractional weight anywhere in it. Space is quantised to the cell and time to the tick, so the field moves the way the rest of the kit moves - in steps. It also only redraws when a whole step changes: a new tick, a new cell under the pointer, a ring gained or lost.
Enhancement only. The canvas is transparent until its first frame, so
a machine without WebGL2 sees the static stripes on the left and loses
nothing. It stops when scrolled off screen, and under
prefers-reduced-motion it draws one settled frame and
never starts a loop.
Where it belongs: an empty state, a title screen, the frame around a hero sign - a place with nothing to read. Not behind body text or controls: a moving checker under a label costs the contrast the Colour section measured, and a ripple under a button reads as the button doing something it is not.
Components
Every piece here is a real control - press it, drag it, tab through it.
Focus is a 2px --focus ring around the whole prop. The one
row of pinned states exists only so hover and pressed can be compared
side by side; everything else is live.
Button · pinned for comparison: rest, hover, pressed, disabled
Buttons · live
Toggles, checks, seed dots
Sliders and segment bar · wired together
Tooltips and field
Panel · sheet, title, rows, close
Panel title
Sound
Music
Flip a toggle: the row swaps its sprite for the muted one. The close button docks two units in from the corner, on top of the edge.
Sprites · 16-cell and 8-cell grids
Why every control is three spans deep
Shell, face, content. The shell carries the edge, the face carries the bevel, and the content is what moves when the piece is pressed - so the outline stays put while the label drops a unit, the way a real key would. Collapse the layers into one element and one of those three jobs has nowhere to live. The real input is always present and only visually hidden, so every toggle, check and seed dot is keyboard and screen-reader native.
Motifs
What makes the kit recognisable at a glance, before a single colour is read. Two ways of laying pixels - stacked box-shadows and integer SVG rects - and a handful of shapes that recur everywhere.
Staircase corner. Two steps, never a curve.
Painted sign. Accent face, glint rim, accent-lo edge and shade, two tendrils.
Stepped tail. One cell plus stacked box-shadow pixels, shown at 4x.
Rect-art sprite. Integer rects, crispEdges, 16 cells.
Seed dot. Two-tone: outline in color, meat in --seed-meat.
Segment dash. Filled or outlined, nothing in between.
Why these, and not the palette
Recolour the kit and it is still recognisable, because the staircase, the one-unit bevel and the rect-art are doing the identifying. That is also why night was possible without redrawing anything: every motif is geometry plus role tokens, and the geometry does not care which theme it is standing in. Before adding a motif, check that it is made of whole units and at most one bevel.
Composition
The pieces assembled into one neutral dialog: a sign overlapping a sheet, a list to choose from, an amount, an option and two actions. Pick a row, set the amount, and the confirm label keeps count. The copy is placeholder, so what you take away is the arrangement.
Dialog title
Anatomy
| Part | As built | Why it is that |
|---|---|---|
| Sign | -5u overlap | The heading sits on the sheet's top edge, not above it, so it reads as a label nailed to the object rather than a caption floating near it. |
| Sheet | --piece-hi, 6u pad | The lightest face in the kit, so the pieces laid on it - rows, buttons, the rail - still read as raised. |
| Rows | 1u --piece rule | Divided by a one-unit line in the piece colour: visible, but quieter than any edge. |
| Level | segment + value | The dashes are a picture of the number, and the number stays beside them. On a phone the dashes go and the number carries it alone. |
| Actions | alt, then piece | The way back is the dark counter-piece; the way forward is the lighter, raised one. The eye lands on the lighter piece first. |
| Close | 2u in from the corner | Docked over the edge, inside the staircase - it belongs to the sheet, not to the page. |
Why it says nothing
Item one, item two, an amount, confirm. Those words were chosen because they imply nothing about what the kit is for. The same arrangement is a settings sheet, an order form, a level select or a file picker, and a reader in any of those fields should be able to lift it whole.
Rules
The refusals matter more than the permissions.
Do
- Build every size as whole units of
--px. - Draw corners with the staircase clip, and edges as an outer layer.
- Give depth with a one-unit bevel, and take it away when pressed.
- Use flat fills and chunky rect-art with
crispEdges. - Put small text on the ground in
--ground-ink, and on a piece in--ink. - Check both themes with the Day / night button in the masthead.
Do not
- Use border-radius, or any smooth curve.
- Add a gradient, a blur, or a shadow with any blur radius.
- Ease anything. Motion is
steps()only. - Set small text in
--piece-edge, or small glint text on the accent. - Invert a piece for night. The ground goes dark; the piece is lamplit.
- Run the furrow field behind text or controls.
- Size the pixel face in rem or in-between steps. It runs 10, 15, 20, 30, 40.