Design system
How this site is drawn
Every value on this page is read from src/design/tokens.ts, the same file that writes the site's CSS, so the page and the screen cannot disagree. Ratios are computed at build time, not typed in.
A ledger, a broadsheet, a drawing
Victoria 3 runs from 1836 to 1936: the century of the account book, the daily paper and the engineering drawing. V3X is engine work with numbers attached, so the site borrows from all three and from nothing later.
| Source | What it lends | Where you see it |
|---|---|---|
| The ledger | Columns of figures that line up; a double rule under the total; before and after side by side. | The front-page table, every table's last row. |
| The broadsheet | A nameplate, a thick-over-thin rule, a dateline strip; questions set in ruled columns; run-in heads. | The masthead, § 1 and § 6 of the front page. |
| The engineering drawing | Numbered plates with captions; numbered callouts for a procedure; a title block in the corner; hairline grids. | Diagrams, install steps, the footer of every page, figures. |
What it refuses: gradients, glass, glow, rounded cards, emoji, stock charts, a centred hero. Corners are square. The only shadow is the brass offset under the primary button, a print register mark, which closes when pressed.
Ink and paper, blueprint by night
12 tokens, two schemes. Light is ledger paper and iron-gall ink, taken from the repo's own diagrams (docs/assets/banner.svg: paper, navy, teal, brass, red). Dark is a blueprint: the same navy as ground, paper as ink. The scheme follows the system setting; there is no switch to load.
| Token | Light | Dark | Role |
|---|---|---|---|
--paper | #f4ecd8 | #13202f | Page ground. Ledger paper by day, blueprint by night. The light value is the banner card of the repo's banner.svg. |
--paper-2 | #ece2c8 | #1a2b3f | Panels, table heads, the masthead strip. |
--paper-3 | #e3d5b2 | #22364d | Code ground, bar tracks, selected rows. |
--ink | #14202e | #efe6d0 | Body text, rules under totals, figure bars. |
--ink-2 | #46505c | #bdb6a4 | Secondary text: captions, dates, footnotes. |
--link | #1f3550 | #a8c8e8 | Links and the primary button. Navy of the V3X banner. |
--on | #2a6467 | #86c9c6 | 'On by default', results with V3X. Teal of the repo diagrams, darkened 10 % for text. |
--brass | #b98b3e | #c9a35a | Ornament only: double rules, the section numerals' hairline. Never text. |
--brass-ink | #6f5220 | #dcbb78 | Brass you can read: kickers and small-caps labels. |
--alarm | #9b2d20 | #ec9a8b | Warnings and 'before' values. Red of the repo diagrams. |
--rule | #bfb398 | #3c516a | Hairlines between rows and columns. Decorative, so no contrast floor. |
--focus | #2f6f73 | #86c9c6 | Keyboard focus ring, 2 px, offset 2 px. |
Contrast, computed
WCAG 2 contrast for every pair a text token is allowed on. Body text needs 4.5:1; the focus ring, a UI mark, needs 3:1. The build fails below the floor.
| Text | On | Scheme | Ratio | Floor |
|---|---|---|---|---|
ink | paper | light | 13.98:1 | 4.5:1 |
ink | paper | dark | 13.25:1 | 4.5:1 |
ink | paper-2 | light | 12.76:1 | 4.5:1 |
ink | paper-2 | dark | 11.57:1 | 4.5:1 |
ink | paper-3 | light | 11.31:1 | 4.5:1 |
ink | paper-3 | dark | 9.92:1 | 4.5:1 |
ink-2 | paper | light | 6.96:1 | 4.5:1 |
ink-2 | paper | dark | 8.15:1 | 4.5:1 |
ink-2 | paper-2 | light | 6.35:1 | 4.5:1 |
ink-2 | paper-2 | dark | 7.11:1 | 4.5:1 |
link | paper | light | 10.60:1 | 4.5:1 |
link | paper | dark | 9.48:1 | 4.5:1 |
link | paper-2 | light | 9.67:1 | 4.5:1 |
link | paper-2 | dark | 8.28:1 | 4.5:1 |
link | paper-3 | light | 8.57:1 | 4.5:1 |
link | paper-3 | dark | 7.10:1 | 4.5:1 |
on | paper | light | 5.72:1 | 4.5:1 |
on | paper | dark | 8.77:1 | 4.5:1 |
on | paper-2 | light | 5.22:1 | 4.5:1 |
on | paper-2 | dark | 7.65:1 | 4.5:1 |
brass-ink | paper | light | 6.14:1 | 4.5:1 |
brass-ink | paper | dark | 8.96:1 | 4.5:1 |
brass-ink | paper-2 | light | 5.61:1 | 4.5:1 |
brass-ink | paper-2 | dark | 7.82:1 | 4.5:1 |
alarm | paper | light | 6.39:1 | 4.5:1 |
alarm | paper | dark | 7.50:1 | 4.5:1 |
alarm | paper-2 | light | 5.83:1 | 4.5:1 |
alarm | paper-2 | dark | 6.54:1 | 4.5:1 |
focus | paper | light | 4.90:1 | 3:1 |
focus | paper | dark | 8.77:1 | 3:1 |
Three faces, nine sizes
Display: Old Standard TT 400, 400 italic, 700 (OFL). A revival of the 'Modern' romans of the late 19th century: the face of the period's newspapers, statute books and engineering catalogues.
Text: Source Serif 4 variable, optical sizes 8-60, weights 200-900 (OFL). A transitional serif with optical sizes, so 15 px captions stay sturdy and 21 px ledes stay fine. Readable for long docs.
Mono: IBM Plex Mono 400, 500 (OFL). Tabular figures by construction: every digit is the same width, so columns of seconds and megabytes line up like a ledger.
All three are served from this site (/fonts/, latin subset, SIL Open Font License). No font CDN. If they fail, the stacks fall back to Georgia and Consolas, which the repo's diagrams already use.
Text uses old-style figures, which sit in a sentence like lower-case letters. Tables, code and figures switch to lining, tabular figures so that digits stack in columns.
The module: 6 px, a nonpareil
Printers of the period named their type sizes; six-point type was nonpareil, the size of footnotes and the width of a column rule. The site's module is 6 px. Every margin, gap and line height is a whole number of modules, so text in neighbouring columns sits on the same lines.
72 modules of 6 px, a major mark every 36 px.
| Token | px | modules | Length |
|---|---|---|---|
--s1 | 6 | 1 | |
--s2 | 12 | 2 | |
--s3 | 18 | 3 | |
--s4 | 24 | 4 | |
--s6 | 36 | 6 | |
--s8 | 48 | 8 | |
--s12 | 72 | 12 | |
--s16 | 96 | 16 |
Twelve columns and a margin for numerals
The page is at most 1176 px wide: 12 columns with 24 px gutters. Sections give two columns to their numeral, as a statute book gives its margin to section numbers, and ten to the text. Running text stops at 64ch, about twelve words a line. Below 900 px the margin folds above the text; below 720 px everything is one column.
Rules, in the printer's sense
| Rule | Drawn | Means |
|---|---|---|
| Hairline | 1 px --rule | Between rows and items. Separates, never encloses. |
| Head rule | 1 px --ink | Under table heads and page titles. |
| Oxford rule | 3 + 1 px | Under the nameplate only. |
| Total rule | double | Under the last row of a table: the account is closed. |
| Brass hairline | 1 px --brass | Over section numerals. Ornament, never text. |
| Warning bar | 3 px --alarm | Left of a note that can cost you something. |
Data set as type
A figure is a table first: label, value, unit, readable by a screen reader and by search. The bar is decoration drawn from the same number. Before is hatched in red, like an engraver's shading; with V3X is solid teal. Hairlines mark each quarter of the scale. The caption names the machine.
| Before | 37.5 s | |
|---|---|---|
| With V3X | 6.7 s |
Components
| Part | Example | Use |
|---|---|---|
| Stamp | on optional no | A state, in the margin of an item. Text, not colour alone. |
| Button | Primary Secondary | One primary action per screen: download. |
| Kicker | Players' guide | Above a headline: where you are. |
| Label | File dated | Table heads, captions of the title block. |
| Note | Single player only. | A caveat that can cost the reader something. |
| Plate | Numbered figure: Plate I, caption, source. | The repo's SVG diagrams. Illustrations say they are not screenshots. |
| Title block | Project · Sheet · Source · Revised | The footer of every page: what this sheet is and where its content came from. |
Words
- Plain, short, sentence case. Write for a player who has never heard of a DLL; put the technical word second, in
code. - Numbers only from the V3X repository, always with the machine they were measured on. Say what is optional and off by default next to its number.
- Say what is not done yet. An illustration says it is not a screenshot.
- Portuguese is Brazilian Portuguese; the docs for modders stay in English and links to them say so.
Rules, and what checks them
| Rule | Checked by |
|---|---|
No colour literal outside src/design/tokens.ts. | scripts/check-tokens.ts, fails the build. |
| Every text pair meets its contrast floor, in both schemes. | scripts/check-tokens.ts, from the table in § 2. |
| Every internal link and #anchor resolves. | scripts/check-links.ts over dist/, fails the build. |
| Content needs no JavaScript; nothing loads from another host. | scripts/check-links.ts: no script but JSON-LD, no external stylesheet, font or image. |
Every image has an alt; every page has one h1, a title and a description. | scripts/check-links.ts. |
Motion only where it explains: a pressed button, smooth scrolling to an anchor. Both removed under prefers-reduced-motion. | CSS media query; review. |
| Docs are the repo's, not a fork. | scripts/sync-docs.ts copies them at build and records the source file date. |