fix(reader): dark text on dark themes and add toggle icons

Two fixes:

1. Remove base typography block from foliate-themes.css. The html/body
   rules were unlayered CSS that overrode the chrome theme's layered
   body styles, causing dark reading theme text colors (--reader-text)
   to apply to the outer chrome UI on dark backgrounds. These styles
   are only meant for the shadow DOM, which getCSS() already handles.

2. Move missing typography rules (img, blockquote, a, p orphans/widows)
   into getCSS() so the shadow DOM still gets them.

3. Add sun/moon emoji indicators to the light/dark toggle switch.
This commit is contained in:
2026-04-19 20:12:34 -04:00
parent 48a8716a25
commit 36de7cfa2f
5 changed files with 31 additions and 52 deletions
+5 -4
View File
@@ -190,15 +190,16 @@ templ ReaderSettingsPanel() {
<h3 class="font-semibold">Reading Theme</h3>
<button
@click="toggleReadingMode()"
class="relative w-12 h-6 rounded-full transition-colors duration-200"
class="relative w-14 h-7 rounded-full transition-colors duration-200 flex items-center px-1"
:class="readingMode === 'dark' ? 'bg-blue-500' : 'bg-gray-400'"
type="button"
:aria-label="readingMode === 'dark' ? 'Switch to light mode' : 'Switch to dark mode'"
>
<span
class="absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full shadow transition-transform duration-200"
:class="readingMode === 'dark' ? 'translate-x-6' : 'translate-x-0'"
></span>
class="absolute top-0.5 left-0.5 w-6 h-6 bg-white rounded-full shadow transition-transform duration-200 flex items-center justify-center text-xs"
:class="readingMode === 'dark' ? 'translate-x-7' : 'translate-x-0'"
x-text="readingMode === 'dark' ? '🌙' : '☀️'"
>☀️</span>
</button>
</div>
<label class="block mb-2">