shipped · v0.3.1 · design & engineering

vault keeps colour and type on disk

A Mac app for the colours, fonts and type scales a project accumulates. One SQLite file on disk.

  • Electron
  • React
  • TypeScript
  • SQLite
  • OKLCH
  • Vitest

The app

The windows on this page are vault itself: its components, styles and logic, copied from the repository and run on a sample library. Everything in them works; nothing is saved, and a reload starts over.

Colours

Add your first colour

Add by hex or extract from an image. We’ll suggest a name, check WCAG contrast, and flag near-duplicates.

The problem

The colours and fonts I collect in the wild end up scattered across screenshots, notes and half-finished Figma files. Vault is one place for them, for one person on one machine. It needs no account, keeps the library in a single SQLite file, and talks to the network only to reach Google Fonts. It has two halves: a library I capture colours and fonts into, and a studio that turns them into palettes and type scales. Tagging assets into a project connects the two.

library · captureColoursFontsstudio · generatePalettesType scalesProjectsall four asset typeslibrary · captureColoursFontsstudio · generatePalettesType scalesProjectsall four asset types
a project gathers all four asset types.

Product decisions

Named on capture. Capturing a colour should cost nothing, so it never asks for a name. As I type a hex, the Add colour dialog offers the nearest of about 31,900 names and fills in the first one the library is not already using. A hex the library already holds warns before it saves. Adding from an image keeps the dominant colours and flags near-identical picks, so the library stays a set of distinct colours rather than a pile; the image tab, in the window at the top of the page, runs vault's extractor on any picture you give it.

Try a hex
ΔE: how far each name looks. lower is closer.

Explore in the create flow, export a snapshot. Every create flow has the same two panes: controls on one side, a live preview on the other, so the exploring happens there. Saving produces a snapshot. A saved palette can be renamed, exported or deleted, and any swatch can be promoted into the library, but its values do not change. Vault is where a palette is explored, not where it is maintained: the saved one is the version that went out to a design tool or to code, as CSS, SCSS, Design Tokens or Tailwind.

New palette

Type
Project
Seed colour (pick 1)

Choose a project to pick seed colours from.

Ramps
Pick a seed colour to preview the ramps.
every change reruns the shared generator.

Fonts are owned; units are a reading. Fonts come from three places. An installed font or an uploaded file is copied into vault's own storage on import, so moving or deleting the original never breaks the library; a Google font is kept as a reference and rendered from Google. A type scale is generated on a modular ratio from one of two presets, a product role set from Display down to Label or h1 to h6 for markup. Sizes are stored once, in px, and the viewer reads them in px, rem or pt, so the unit is how I am looking at the scale rather than part of it; export writes whatever is selected. Hand-tuning a step past the ratio marks the scale Custom.

Size
Tracking
every size re-reads. the scale stays put.

One pattern per job. A colour or a font is a quick look, so it opens in a drawer over the library and the grid stays where I left it; a palette or a type scale is a worked object with an export, so it gets a page. Cards are a whole-card button with a pen on hover, and create flows are the two panes above. Favourites are a filter rather than a section, copy feedback is inline, deletes confirm, duplicates warn, and an empty section says how to fill it. Learning one section teaches the other three.

Ruby only for actions. Ruby is vault's accent: a ten-step ramp built in OKLCH around #AA1155 and #880044. It marks what I can act on: primary buttons, the active filter and nav item, and focus rings. Everything else is grey, so the colours being collected stay the brightest thing on screen. The favourite star is gold, because a favourite is state and should not read as a button. The window at the top of the page shows it: grey everywhere, ruby only on what acts.

⌘K as a second route. The command palette opens over any screen to jump to a section or project, start a new asset, or open a colour by name. Every action in it is also on the sidebar or a toolbar, so it speeds up someone who knows the app without hiding anything from someone who does not. Ranking favours runs of letters and word starts, so tsc finds Type scales.

Try

The reasons and the alternatives behind each decision are in DESIGN.md.

Design system

Vault is built on haus, my design system. It takes haus's token layer whole, the roles and the primitives, and adds one file of its own: a brand, which is where ruby is chosen. The components are vault's.

49 components in three tiers. They are named as they are in Figma: 15 atoms, 16 molecules and 18 organisms, composed into five pages. Nothing imports upward: ESLint fails an import that climbs a tier (vault#82). Every value comes from the haus token layer, and the interface is set in Manrope, bundled with the app because an offline app cannot load a font from a CDN.

Components never name a colour. A component reads a role, the role reads the brand, and the brand reads a primitive. vault's brand file is the only place ruby is chosen, so changing the brand recolours every action without touching a component. The favourite star reads vault's own gold instead, outside the role, so it holds when the brand moves.

Brand
the button follows the brand. the star doesn't.

Raw values fail the build. Stylelint fails any colour, type size, spacing, radius or z-index written as a raw value instead of a token, on a config ported from haus, so the system and the app agree on what counts as a bypass. The exceptions are listed in the config, grouped, each with its reason: white text on a swatch the user chose, where no role describes the surface underneath, and type sizes outside the scale, because in a font tool some type is the subject rather than the interface.

All four properties, or not on the role. A component on a haus type role declares its size, weight, leading and tracking together. One that takes the size and sets the rest by hand has quietly left the role, and nothing shows it. Seven places had, until September: Badge and Chip disagreed side by side in a viewer header, and MenuOption drew two row heights because only one of its forms inherited a leading.

Nine accessibility fixes. I audited the atoms and molecules against WCAG 2.2 and the ARIA patterns they claim, and fixed the eight defects the audits found, plus a ninth in the command palette, where Tab walked out of the dialog. One example: SegmentedControl rendered as tabs, which promises tab panels it did not have. All seven uses pick one value from a set, so it became a radio group with one Tab stop and arrow keys (vault#45).

// atoms/SegmentedControl.tsx, before
<div role="tablist">                        // promises tab panels it does not have
  <button role="tab" aria-selected={on}>    // every segment a Tab stop

// after (vault#45)
<div role="radiogroup">
  <button role="radio" aria-checked={on}
          tabIndex={on ? 0 : -1}             // one Tab stop for the group
          onKeyDown={onKeyDown}>             // arrows move and choose

Figma checked on every pull request. The five Figma files and the code describe the same system, so a script compares them on every pull request: vault's tokens, and each component's tier, variant axes and states. It keeps the pair of values both sides last agreed, which says which side moved. Code ahead of Figma fails the build; a change made in Figma opens an issue for me to decide. The check started with 39 known differences: seven were brought together, and the other 32 are recorded as exceptions, each with its reason (vault#81).

What changed, on each side
What changedLast agreedNow
Codemd|smlg|md|sm
Figmamd|smmd|sm
failingfigma parity · axis Button.size

Code ahead of Figma. Fails the pull request until Figma has the size, or the drift is accepted.

the Button size from vault#80, in each order.

The token chain, the tier rules and the full audit record are in DESIGN.md; what the parity check compares, and the differences it leaves out with a reason each, are in WORKFLOW.md.

Engineering

One typed boundary. Main owns everything privileged: the SQLite file, the font files, the network. The renderer is a React app running sandboxed and context-isolated, with nodeIntegration off, so it cannot reach the disk at all. Between them, a preload exposes one typed window.api object and holds no logic: every method is one line that forwards to main, so a renamed handler is a compile error rather than a runtime undefined. The windows on this page answer that same object in memory, which is why vault's components run here unchanged. Star the colour below and watch the call cross.

one typed method, one channel, one query.

Shared colour maths. A tonal palette is computed twice: the renderer previews it as you drag the seed, and main regenerates it before writing to SQLite. Two copies of that maths would drift. So the generators are pure functions in shared/, with no DOM, Node or Electron, imported by both processes.

One SQLite file. It holds colours and fonts, palettes and type scales with their steps, and a tag join that lets any of the four belong to projects, a palette or a type scale to at most one, a rule the interface keeps. Because that join points at four different tables, SQLite cannot give it a foreign key or cascade it. So every delete clears its own project rows in the same transaction; a missed one would leave a project counting things that no longer exist.

An update never costs a library. Vault stamps its schema version into the file. It refuses to open a library written by a newer version, and says why, rather than failing query by query on missing columns. Before its one destructive step, recreating the tables for a new schema, it copies the file beside itself, labelled with the version it came from, so an update can never be why someone loses a library they spent months building.

Three requests, all fonts. Vault makes three outbound requests, all to Google Fonts, and each starts from something I do with a font: opening the font adder, downloading a file, previewing a Google family. Two leave from main. The preview leaves from the renderer, because rendering a Google font means linking its stylesheet into the page, and the build's Content-Security-Policy allows those hosts and nothing else. There is no telemetry, no account check and no update ping, and main refuses any navigation away from the bundled app.

Perceptual naming. RGB distance picks names that look wrong, so the nearest-name search runs in a perceptual space: a fast CIE76 pass cuts the name list to a shortlist, then CIEDE2000, the accurate and slower measure, ranks it. The palette generators also check every result for hue coverage and near-duplicates. Both run above as vault's own code, the search in the Add colour dialog and the generators in the create flow.

Tested on the built app. 308 unit and component tests cover the pure logic directly (the exporters, both generators, gamut mapping, type units, the command filter), and 20 of the 22 component files run axe. An end-to-end suite launches the built app, so main, preload, renderer and SQLite are all real, and checks that a colour is added, named and saved through IPC and that the renderer cannot reach Node. CI runs all of it, with a production build, on every pull request.

The process model, the data model, the security boundary and the tests are in ARCHITECTURE.md.

Where it stands

components
49
components
accessibility fixes
9
audit record

Vault is at v0.3.1 and I use it. Four things are open. The library lives in the app's own folder, and Vault neither backs it up nor syncs it; the next step is a folder you choose, holding the data and font files together. Installed variable fonts import as a single weight. A saved palette or type scale cannot yet be the start of a new one, so a variation starts from scratch. The build is unsigned, so first launch needs a Gatekeeper step.

The design notes are in DESIGN.md and the engineering notes in ARCHITECTURE.md.