aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md10
-rw-r--r--docs/THEMES.md8
-rw-r--r--internal/config/config.go2
-rw-r--r--internal/config/config.toml1
-rw-r--r--internal/config/config_test.go3
-rw-r--r--internal/web/render_test.go2
-rw-r--r--internal/web/server.go2
-rw-r--r--internal/web/static/base.css8
-rw-r--r--internal/web/static/themes/deus_vult.css49
-rw-r--r--internal/web/static/themes/memento_mori.css2
-rw-r--r--internal/web/templates/index.html5
11 files changed, 34 insertions, 58 deletions
diff --git a/README.md b/README.md
index 41ac525..c9937ec 100644
--- a/README.md
+++ b/README.md
@@ -214,14 +214,16 @@ only; the file itself is never rewritten.
## Themes
-`lectio-web` ships 15 built-in, colour-only themes (they set colours — and,
-at most, one optional reading font via `--theme-font` — with all spacing,
-borders and layout fixed in `base.css`):
+`lectio-web` ships 14 built-in, colour-only themes (they set colours — with
+all fonts, spacing, borders and layout fixed in `base.css`). A theme may
+additionally set `--theme-font` to change the reading face, and a monospace
+reading face can be turned on for any theme (see `web_mono` and the "mono"
+top-bar toggle below):
Religious orders: `transfiguration` (dark, gold/olive — the default),
`desert_fathers` (light, sand/umber), `benedictines` (dark, black/gold),
`franciscans` (dark, brown/terracotta), `memento_mori` (dark, greyscale,
-monospace), `deus_vult` (armor grey/red), `dominicans` (black & white).
+monospace), `dominicans` (black & white).
Liturgical seasons and feasts: `advent` (dark violet), `nativity` (light
white/gold), `lent` (dark ashen violet), `easter` (light radiant gold),
diff --git a/docs/THEMES.md b/docs/THEMES.md
index 399e208..0d7f646 100644
--- a/docs/THEMES.md
+++ b/docs/THEMES.md
@@ -28,6 +28,12 @@ sets it to a monospace stack; every other built-in leaves it alone. Set this
one variable if you want a different reading face — never a bare
`font-family` on an element.
+**Monospace for any theme.** Independently of the theme, `lectio-web` can force
+the reading face to monospace: set `web_mono = true` in your config, or flip the
+**mono** checkbox in the top bar. It overrides whatever `--theme-font` the current
+theme uses (the UI chrome stays as is), and persists as you change date, theme or
+version. `memento_mori` simply ships with it on.
+
## The role variables and classes
Every built-in theme, and every user theme, **must** define all of these —
@@ -108,8 +114,6 @@ Religious orders:
tau/terracotta `#a8703a`, link/refrain olive.
- **memento_mori** (dark, greyscale) — ash `#1a1a1a` / bone `#d8d4cc`;
`#7a4a42` (dried blood) is reserved for the `.error` role only.
-- **deus_vult** (armor grey / red) — plate grey `#bcc1c6` / steel `#20242a`,
- accent Templar red `#a81b23`, refrain deep red `#8a1f27`, steel borders.
- **dominicans** (black & white) — white habit `#f6f5f3` / black cappa
`#1c1c1c`; greyscale only, no accent colour.
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 @@
<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>