feat: use CSS prefers-color-scheme for dark mode (no JS)
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 7s
Mirror to GitHub / mirror (push) Failing after 5s
Tests / test (push) Successful in 27s

- Remove inline JS that sets data-theme from localStorage
- Use @media (prefers-color-scheme: dark) in CSS for automatic dark mode
- Remove JS-dependent theme toggle from preferences
- Theme now follows system preference automatically

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude 2026-03-23 18:34:18 +00:00
parent 8f2fd671f1
commit 056d2d1175
3 changed files with 3 additions and 31 deletions

View file

@ -1,6 +1,6 @@
{{define "base"}}
<!DOCTYPE html>
<html lang="en" data-theme="light">
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@ -12,7 +12,6 @@
<link rel="icon" href="/static/img/favicon.svg" type="image/svg+xml">
<link title="samsa" type="application/opensearchdescription+xml" rel="search" href="/opensearch.xml">
<meta name="samsa" content="samsa">
<script>var s=document.documentElement;s.setAttribute('data-theme',localStorage.getItem('samsa-theme')||'light');</script>
</head>
<body>
<header class="site-header">