Dark Mode folgt Browser-Einstellung (prefers-color-scheme), Toggle entfernt

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-13 12:34:56 +02:00
co-authored by Claude
parent e97d1b3687
commit 0c866805d3
10 changed files with 3 additions and 197 deletions
+3 -4
View File
@@ -1,12 +1,12 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bewerbungs-Tracker</title>
<!-- Apply the dark class before first paint to avoid a light-mode flash (FOUC). -->
<!-- Apply the dark class before first paint to avoid a light-mode flash (FOUC).
Theme follows the browser/OS setting (prefers-color-scheme) — no manual toggle. -->
<script>
(function () {
try {
var dm = localStorage.getItem('darkMode');
if (dm === 'enabled' || (!dm && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.classList.add('dark');
}
} catch (e) { /* ignore */ }
@@ -15,7 +15,6 @@
<!-- Tailwind CSS CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<script>
// Toggle dark mode via the `.dark` class (default is `media`, i.e. OS-driven)
tailwind.config = { darkMode: 'class' };
</script>
<!-- Custom CSS -->