This commit is contained in:
team3
2026-06-04 00:26:05 +02:00
parent c73d07be52
commit 614bce2c89
16 changed files with 491 additions and 185 deletions

View File

@@ -751,4 +751,25 @@ Example (PHP-flavored, but the pattern is language-agnostic):
- [ ] Tables for comparisons/lists; code blocks only if technical, short, escaped
- [ ] Prose in the reader's language; terms explained on first use
- [ ] Built with WeasyPrint and **visually verified** by rendering pages
- [ ] Both HTML and PDF delivered
- [ ] Both HTML and PDF delivered
## 11. Dark mode (required)
The app toggles dark mode by setting `data-theme="dark"` on `<html>` inside its preview. Print/PDF always stays light.
- Define every color through the `:root` variables only (`--ink`, `--muted`, `--line`, `--bg-soft`, accent trio).
- Ship an additional override block:
```css
@media screen {
html[data-theme="dark"] {
--ink: #e6e8ee; --muted: #9aa3b2; --line: #2c3038; --bg-soft: #23262e;
/* lift accent shades so headings/links stay readable on dark */
}
html[data-theme="dark"] body { background: #15171c; }
}
```
- Do NOT use `prefers-color-scheme` — the app controls the attribute.
- Keep dark rules inside `@media screen` only, so WeasyPrint/PDF renders the light theme.
- Elements with light text on accent backgrounds (table headers, cover) may keep their light-theme background.