diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-23 16:13:56 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-23 16:13:56 +0200 |
| commit | 36d87e27019fce743e63be87222e987510863e6f (patch) | |
| tree | b5cffac3c1aa417fa24da79a99b6da85828fceb3 /internal/web | |
| parent | 90c8dfc6cc3ab4b6b78feec5f738beeb41fb9605 (diff) | |
| download | lectio-36d87e27019fce743e63be87222e987510863e6f.tar.gz lectio-36d87e27019fce743e63be87222e987510863e6f.zip | |
web: remove deus_vult theme; add global monospace toggle (web_mono config + top-bar 'mono')
Diffstat (limited to 'internal/web')
| -rw-r--r-- | internal/web/render_test.go | 2 | ||||
| -rw-r--r-- | internal/web/server.go | 2 | ||||
| -rw-r--r-- | internal/web/static/base.css | 8 | ||||
| -rw-r--r-- | internal/web/static/themes/deus_vult.css | 49 | ||||
| -rw-r--r-- | internal/web/static/themes/memento_mori.css | 2 | ||||
| -rw-r--r-- | internal/web/templates/index.html | 5 |
6 files changed, 16 insertions, 52 deletions
diff --git a/internal/web/render_test.go b/internal/web/render_test.go index 126cb84..0e64168 100644 --- a/internal/web/render_test.go +++ b/internal/web/render_test.go @@ -21,7 +21,7 @@ func TestBuiltinThemes(t *testing.T) { t.Setenv("XDG_CONFIG_HOME", t.TempDir()) // no user themes for _, name := range []string{ "transfiguration", "desert_fathers", "benedictines", "franciscans", - "memento_mori", "deus_vult", "dominicans", "advent", "nativity", "lent", + "memento_mori", "dominicans", "advent", "nativity", "lent", "easter", "pentecost", "ordinary", "epiphany", "marian", } { if b, err := themeCSS(name); err != nil || len(b) == 0 { diff --git a/internal/web/server.go b/internal/web/server.go index 3fe1e4e..c7e645d 100644 --- a/internal/web/server.go +++ b/internal/web/server.go @@ -164,6 +164,7 @@ type indexData struct { ThemeOpts []themeOpt Theme string Display string + Mono bool Ref string Lookup template.HTML Reading template.HTML @@ -224,6 +225,7 @@ func indexHandler(cfg config.Config) http.HandlerFunc { ThemeOpts: themeOpts, Theme: theme, Display: display, + Mono: queryBool(r, "mono", cfg.WebMono), Ref: ref, Lookup: lookup, Reading: reading, diff --git a/internal/web/static/base.css b/internal/web/static/base.css index 776c934..59c67aa 100644 --- a/internal/web/static/base.css +++ b/internal/web/static/base.css @@ -13,6 +13,7 @@ * (the ONE sanctioned type override; base.css still owns sizing/spacing). */ --font-reading: var(--theme-font, Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif); --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; + --font-mono: ui-monospace, "Cascadia Code", "SF Mono", "Roboto Mono", Menlo, Consolas, monospace; --measure: 42rem; --space-1: 0.5rem; --space-2: 1rem; @@ -39,6 +40,13 @@ body { color: var(--fg); } +/* Global monospace reading toggle (config web_mono / the "mono" top-bar + * checkbox): forces the reading face to mono over whatever the theme uses, + * for any theme. UI chrome (--font-ui) is untouched. */ +body.mono { + --font-reading: var(--font-mono); +} + .page { max-width: 64rem; margin: 0 auto; diff --git a/internal/web/static/themes/deus_vult.css b/internal/web/static/themes/deus_vult.css deleted file mode 100644 index 2388fbe..0000000 --- a/internal/web/static/themes/deus_vult.css +++ /dev/null @@ -1,49 +0,0 @@ -/* deus_vult -- religious-order palette (crusader / Templar): plate-armor - * grey field, steel, red cross. Colour only; see docs/THEMES.md. - */ -:root { - --bg: #bcc1c6; /* plate-armor grey */ - --fg: #20242a; /* dark steel */ - --muted: #5c636b; /* steel-grey */ - --accent: #a81b23; /* Templar cross red */ - --link: #3f4a55; /* dark steel-slate */ - --refrain: #8a1f27; /* deep red */ - --border: #9aa0a6; /* steel */ -} - -.heading { - color: var(--accent); -} - -.citation { - color: var(--muted); -} - -.vnum { - color: var(--muted); -} - -.refrain { - color: var(--refrain); -} - -a { - color: var(--link); -} - -a:hover, -a:focus { - color: var(--accent); -} - -.controls, -.version-label, -.reading-section + .reading-section { - border-color: var(--border); -} - -.controls input, -.controls select, -.controls button { - border-color: var(--border); -} diff --git a/internal/web/static/themes/memento_mori.css b/internal/web/static/themes/memento_mori.css index d99911b..f6e5174 100644 --- a/internal/web/static/themes/memento_mori.css +++ b/internal/web/static/themes/memento_mori.css @@ -12,7 +12,7 @@ --border: #333330; --error: #7a4a42; /* dried blood -- error/alert accent only */ /* the one non-colour override: a monospace reading face (see base.css). */ - --theme-font: ui-monospace, "Cascadia Code", "SF Mono", "Roboto Mono", Menlo, Consolas, monospace; + --theme-font: var(--font-mono); } .heading { diff --git a/internal/web/templates/index.html b/internal/web/templates/index.html index 03c0078..8c88779 100644 --- a/internal/web/templates/index.html +++ b/internal/web/templates/index.html @@ -21,7 +21,7 @@ <link id="theme" rel="stylesheet" href="/theme.css?name={{.Theme}}"> <script src="/static/htmx.min.js"></script> </head> -<body> +<body{{if .Mono}} class="mono"{{end}}> <div class="page"> <form id="controls" class="controls" hx-get="/readings" hx-target="#pane" hx-trigger="change"> @@ -69,6 +69,9 @@ </select> </label> + <label class="mono-toggle"><input type="checkbox" {{if .Mono}}checked{{end}} + onchange="document.body.classList.toggle('mono', this.checked)"> mono</label> + <form id="lookup-form" class="controls" hx-get="/lookup" hx-target="#lookup-results" hx-include="#controls"> <input type="text" name="ref" placeholder="np. J 20:1" value="{{.Ref}}"> <button type="submit">szukaj</button> |
