Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

3.4 KB
Raw Blame
/**
 * Font faces for every theme, bundled with the app so the desktop build renders offline.
 *
 * A browser fetches a font FILE only when some element's `font-family` names its family and the
 * text falls inside the face's `unicode-range`. Each theme file under `themes/` names only its own
 * families, so a session downloads the active theme's faces and nothing else: Primer's Mona Sans
 * and JetBrains Mono or Console's Latin faces, each with the Noto Sans SC slices its CJK text
 * touches, or Frost's MiSans slices and JetBrains Mono. The DECLARATIONS are another
 * matter: every theme's faces are declared unconditionally here, so these rules sit in the app's
 * main stylesheet and every session downloads them (about 94 KB gzipped, most of it MiSans's and
 * Noto's `unicode-range` lists). That cost was accepted on 2026-09-18 over loading each theme's
 * font sheet on demand. A consumer's build must not inline the font files (`assetsInlineLimit`),
 * or small slices would ride in that stylesheet as data URIs. The unconditional declarations are
 * also what lets the user's font pairing (boot.ts, theme.css's `ui-font` layer) name any of these
 * families under any theme: a chosen face is downloaded the moment a stack names it.
 *
 * | theme           | sans (reading)                     | ui (chrome)            | mono                          | CJK                          |
 * | --------------- | ---------------------------------- | ---------------------- | ----------------------------- | ---------------------------- |
 * | Primer `github` | Mona Sans Variable                 | = sans                 | JetBrains Mono Variable       | Noto Sans SC Variable        |
 * | Frost `modern`  | MiSans 400 / 500                   | = sans                 | JetBrains Mono Variable       | MiSans (the same family)     |
 * | Console `geek`  | IBM Plex Sans Variable             | = sans                 | JetBrains Mono Variable       | Noto Sans SC Variable        |
 *
 * The display face is the chrome face in every theme (Console's h1 is the Plex Sans bold); IBM
 * Plex Sans Condensed stays declared in `geek.css` until its dependency is dropped.
 *
 * Every face but MiSans is SIL Open Font License 1.1 and arrives through a fontsource package,
 * whose licence text `scripts/sync-font-licenses.mjs` mirrors into `LICENSES/`. MiSans has no
 * official package: `scripts/build-misans.py` cuts its slices from Xiaomi's download into
 * `misans/`, and its licence is transcribed into `LICENSES/misans.txt` (`vendored-fonts.json`
 * lists it). The `penguinUi()` Vite plugin emits every text in `LICENSES/` beside the build as
 * `fonts-licenses/<name>.txt`. `README.md` has the families, licences, sources and bytes.
 *
 * The Latin faces are hand-declared (latin + latin-ext only, normal style, woff2) instead of
 * importing fontsource's stylesheets, which would also bundle the cyrillic, greek and vietnamese
 * slices and the woff fallbacks. Their `url()`s are paths relative to the file that holds them,
 * into this package's own node_modules: a bare `@fontsource…` specifier would be resolved from the
 * CONSUMER's stylesheet (Tailwind inlines every `@import` and leaves bare `url()`s untouched), and
 * the consumer does not depend on fontsource. A relative path is rebased by Tailwind and resolves
 * from here.
 */
@import "./github.css";
@import "./modern.css";
@import "./geek.css";
@import "./cjk.css";