From 36d87e27019fce743e63be87222e987510863e6f Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Thu, 23 Jul 2026 16:13:56 +0200 Subject: web: remove deus_vult theme; add global monospace toggle (web_mono config + top-bar 'mono') --- internal/config/config.go | 2 ++ internal/config/config.toml | 1 + internal/config/config_test.go | 3 ++ internal/web/render_test.go | 2 +- internal/web/server.go | 2 ++ internal/web/static/base.css | 8 +++++ internal/web/static/themes/deus_vult.css | 49 ----------------------------- internal/web/static/themes/memento_mori.css | 2 +- internal/web/templates/index.html | 5 ++- 9 files changed, 22 insertions(+), 52 deletions(-) delete mode 100644 internal/web/static/themes/deus_vult.css (limited to 'internal') diff --git a/internal/config/config.go b/internal/config/config.go index c15b5a0..ebe687f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -64,6 +64,7 @@ type Config struct { WebTheme string `toml:"web_theme"` WebPort int `toml:"web_port"` WebDisplay string `toml:"web_display"` + WebMono bool `toml:"web_mono"` Parts map[string]map[string]bool `toml:"parts"` } @@ -92,6 +93,7 @@ func Default() Config { WebTheme: "transfiguration", WebPort: 0, WebDisplay: "horizontal", + WebMono: false, Parts: nil, } } diff --git a/internal/config/config.toml b/internal/config/config.toml index cfcb85b..3a15de2 100644 --- a/internal/config/config.toml +++ b/internal/config/config.toml @@ -9,6 +9,7 @@ offline = false # true = never fetch; read only harvested sigla + ca web_theme = "transfiguration" # built-in order/season theme or a user theme in ~/.config/lectio/themes/ web_port = 0 # lectio-web port; 0 = try 1099, then any free port web_display = "horizontal" # lectio-web layout: "horizontal" (stacked), "vertical" (columns), "interlinear" (verse-by-verse) +web_mono = false # lectio-web: monospace reading face for any theme (also a top-bar "mono" toggle) # Which parts to show. Both tables are commented out -> every part is shown. # Uncomment a table and set a part to false to hide it; parts you don't list diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 9ca311b..d2f3203 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -38,6 +38,9 @@ func TestLoadOverride(t *testing.T) { func TestWebDefaults(t *testing.T) { def := Default() + if def.WebMono { + t.Errorf("WebMono default should be false") + } if def.WebTheme != "transfiguration" { t.Errorf("WebTheme default wrong: got %q, want %q", def.WebTheme, "transfiguration") } 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 @@ - +
@@ -69,6 +69,9 @@ + + -- cgit v1.3