mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 13:31:08 -05:00
Implement robust security headers, including CSP with nonces, and integrate comprehensive SEO meta tags into the base template and homepage. Add inline styles for CSP compliance and improve theme management script for immediate theme application. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 48ecdb60-d0f0-4b75-95c9-34e409ef35fb Replit-Commit-Checkpoint-Type: intermediate_checkpoint
16 lines
413 B
JavaScript
16 lines
413 B
JavaScript
/**
|
|
* Theme management script
|
|
* Prevents flash of wrong theme by setting theme class immediately
|
|
*/
|
|
(function() {
|
|
let theme = localStorage.getItem("theme");
|
|
if (!theme) {
|
|
theme = window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
? "dark"
|
|
: "light";
|
|
localStorage.setItem("theme", theme);
|
|
}
|
|
if (theme === "dark") {
|
|
document.documentElement.classList.add("dark");
|
|
}
|
|
})(); |