UI: user customisation — font family (Atkinson Hyperlegible), font size, custom CSS #8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The UI's typography is fixed: one system font stack, one base size. I'd like to read in Atkinson Hyperlegible at a size I choose — and, more generally, to restyle the reader to my taste without forking the stylesheet.
Goal
User-controlled UI customisation:
Findings
:rootdefines--font-family(system stack) and a--font-size-*scale, so a custom font and base size are two variable overrides.font-size: 16px(body) sits outside the variable scheme — needs sweeping into it as part of this change.base.htmlloads exactly one stylesheet, so injecting a user-CSS block after it (inline<style>or a/settings/custom.cssroute serving the stored CSS) wins the cascade by default.static/so the font works without any external CDN (important: the reader may run offline/LAN-only). The custom-CSS route (@font-facepointing at user-hosted files) remains as an escape hatch either way.Plan of attack
settingskey/value table + alembic migration;db/settings.pyaccessors.base.html: afterstyle.css, emit the overrides —--font-family/--font-size-basevariables set from settings, then the user's custom CSS verbatim.static/fonts/with@font-facein the built-in stylesheet, so selecting it needs no network.Resolved by PR #27 (merged): per-user settings store (alembic migration + db/settings.py), user-settable theme with system/light/dark override, Atkinson Hyperlegible bundled as woff2 with its OFL license, validated base font size, and custom CSS with style-breakout guard. Also fixed during review: web app now self-migrates on startup and seeds the default user (both found as real-deployment crashes), plus a generated 0600 secret key file.