System Studio
Presets and Randomize Design
A preset is a complete identity. Randomize Design generates new ones within curated relationships and hard constraints. Everything on this page is read from the same modules the Studio runs.
Preset composition
A preset is a bundle of values for every design dimension, never just a palette. It sets theme, accent, typeface, fine-tuning (reset to default), spacing, corners, button, card, navigation, hero, project presentation and motion. It never changes content. Selecting a preset applies the whole bundle as one history entry; changing anything afterwards marks the design as Custom (the Studio compares the current values with the preset bundle). Editorial is the original identity and equals the defaults, so Reset returns to exactly it.
| Preset | theme | accent | type | density | radius | button | card | nav | hero | projects | motion |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Editorial Bold, cinematic, ink and lavender | Match device | Lavender | Grotesk | Comfortable | Sharp | Solid | Raised | Minimal | Editorial | Cinematic | Match my device |
| Swiss Minimal Calm, light and orderly | Light | Ember | Neo-grotesk | Spacious | Subtle | Outline | Outlined | Boxed | Split | Grid | Subtle |
| Neo Brutalism Loud type, hard borders, offset shadows | Light | Rose | Poster | Comfortable | Sharp | Offset shadow | Offset | Split | Asymmetric | Masonry | Dynamic |
| Modern Studio Soft, floating and contemporary | Dark | Violet | Studio | Comfortable | Rounded | Solid | Raised | Floating | Centered | Horizontal gallery | Smooth |
| Terminal Monospaced, dark and precise | Dark | Acid | Mono | Compact | Sharp | Ghost | Outlined | Minimal | Split | Index | Subtle |
| Luxury Editorial Elegant serif, generous whitespace | Light | Sand | Luxe serif | Extra spacious | Subtle | Underline | Minimal | Centered | Full bleed | Cinematic | Smooth |
Presets also set display size and border weights through the preset token variants (for example Neo Brutalism uses 2px and 3px borders and larger display type). A preset never overrides an OS reduced-motion request: motion is left as it is.
Randomization architecture
The engine is one pure module, src/studio/randomize.ts. It reads a configuration and returns a patch; it does not touch the page, the store or content. Rendering lives elsewhere.
- Families (curated relationships). Each preset doubles as a family: the values that belong together. A run picks a family other than the current one, then draws each value from the family about 82% of the time and from the whole list otherwise, so results are coherent but not predictable.
- Rules. Hard compatibility, quality and accessibility constraints over a complete configuration (below).
- Locks. A locked category is never changed. Rules only repair values that are free.
- Rejection sampling. Up to 400 candidates are generated until one breaks no repairable rule, is not a repeat of the last eight designs, and differs enough from the current one. If the rules cannot be met because of locks, the least-violating candidate is returned with the unresolved rule ids.
- One action. The result is a complete patch (every design key, locked ones at their current value) applied through the store once, so one randomization is one history entry, one view transition and one scene rebuild.
| Family | Typefaces | Accents | Hero | Projects | Motion |
|---|---|---|---|---|---|
| Editorial | Grotesk, Neo-grotesk, Studio | Lavender, Signal, Ember, Acid, Amber, Rose | Editorial, Full bleed, Split | Cinematic, Index, Grid | Cinematic, Smooth, Subtle |
| Swiss Minimal | Neo-grotesk, Geometric, Studio | Ember, Cobalt, Crimson, Emerald, Signal | Split, Centered, Asymmetric | Grid, Index, Masonry | Subtle, Smooth |
| Neo Brutalism | Poster, Geometric, Neo-grotesk | Rose, Ember, Acid, Cyan, Amber, Crimson, Lavender | Asymmetric, Split, Editorial | Masonry, Grid, Index | Dynamic, Cinematic, Subtle |
| Modern Studio | Studio, Geometric, Neo-grotesk | Violet, Lavender, Cyan, Emerald, Rose, Cobalt | Centered, Split, Full bleed | Horizontal gallery, Grid, Masonry, Cinematic | Smooth, Cinematic, Dynamic |
| Terminal | Mono, Geometric, Neo-grotesk | Acid, Emerald, Cyan, Amber, Signal | Split, Editorial, Asymmetric | Index, Grid, Masonry | Subtle, Smooth, Off |
| Luxury Editorial | Luxe serif, Warm serif, Studio | Sand, Amber, Crimson, Lavender, Signal | Full bleed, Centered, Editorial | Cinematic, Horizontal gallery, Index | Smooth, Subtle, Cinematic |
Randomized dimensions: theme, accent, type, hscale, weight, leading, tracking, density, radius, button, card, nav, hero, projects, motion. Fine typography settings return to the defaults with the typeface (and occasionally take a mild variation). Custom accent colours and content are never generated.
Compatibility and accessibility rules
| Rule | Kind | Dimensions | Why |
|---|---|---|---|
accent-presence-light | accessibility | theme, accent | On a light page the accent fill needs enough presence to identify controls; pale accents (Signal, Acid) are kept for dark pages. |
single-weight-type | compatibility | type, weight | The poster typeface has a single weight, so weight shifts are not offered with it. |
poster-size | quality | type, hscale | The poster typeface is already tall and condensed: heading size stays at or below the default. |
tight-tracking-wide-faces | quality | type, tracking | Monospaced and poster faces keep default or wide letter spacing, so glyphs never collide. |
mono-leading | quality | type, leading | Monospaced type needs at least the default line height to stay legible. |
pill-needs-filled-button | compatibility | radius, button | A pill corner needs a solid, outline or ghost button; underline and offset buttons have no shape to round. |
offset-card-corners | compatibility | radius, card | An offset shadow card keeps square to soft corners, so the hard shadow stays aligned. |
offset-button-corners | compatibility | radius, button | An offset shadow button keeps square to soft corners. |
compact-readability | accessibility | density, leading, hscale | Extra compact spacing needs at least the default line height and a heading size at or below the default. |
cinematic-needs-motion | quality | projects, motion | The cinematic project scenes are scroll-driven, so they need motion to be on. |
Accent contrast is not a rule the randomizer has to enforce: text on the accent, accent text and focus rings are derived for every accent so they reach 4.5:1, and npm run tokens:check verifies it for all twelve accents on both themes.
The presence rule (minimum 1.4:1 of the fill against a light page) is a design-quality guard, not a WCAG claim. Every preset also satisfies every rule (asserted by the test suite).
Category locks
Six categories can be locked with a lock icon. A locked category keeps its exact values through any number of randomizations; free categories change around it, and the rules still apply to them. When everything is locked the button explains that nothing can change instead of silently doing nothing. When the device requests reduced motion, motion behaves as locked.
| Lock | Dimensions held |
|---|---|
| Colors | theme, accent, customAccent |
| Type | type, hscale, weight, leading, tracking |
| Layout | hero, projects, nav |
| Components | button, card, radius |
| Spacing | density |
| Motion | motion |
Locks belong to the visitor and are stored on their device (bf-studio-locks).
History, persistence and export
- Undo and redo. The store keeps up to 60 states. A preset, a randomization and a reset are each one entry; a burst of colour-picker changes is merged into one. A new change after an undo discards the redo branch. Ctrl+Z and Ctrl+Shift+Z work when no text field has focus.
- Races. Every change is built on the requested state (
target), not on what is already painted, so rapid clicks or repeated randomizations cannot overwrite each other. The preview frame is mirrored from the editor store without adding history entries. - Scroll. Before a change is painted the motion controller records which section or project is a quarter of the way down the viewport and restores it after the layout settles; all ScrollTriggers are killed and rebuilt once per change.
- Persistence. The configuration is saved locally (
bf-config, schema version 3). Older saves are migrated (renamed values) and any invalid value falls back to its default. Nothing is sent anywhere. - Reset and export. Reset restores the original Editorial. Export writes the configuration, instance overrides and every resolved token to a JSON file on the visitor's device.
bfStudio.set({ hero: 'centered' }); // validated, one history entry
bfStudio.undo(); bfStudio.redo();
bfStudio.history(); // { canUndo, canRedo, depth }
bfStudio.reset(); // back to the original EditorialWhat is verified
npm run test:studio runs the engine with seeded randomness: preset validity and distinctness, accent derivation, thousands of randomizations from random starting points with random locks (locks never change, no repairable rule violated, no immediate repeat), reduced-motion handling and dead-rule detection. It tests data and rules, not rendering. Visual and interaction checks are done in a real browser and recorded in the project README.