make appearance consistent

This commit is contained in:
Cory Dransfeldt 2023-03-15 19:52:53 -07:00
parent a80789dc41
commit 6057eb7065
No known key found for this signature in database
2 changed files with 11 additions and 0 deletions

View file

@ -23,6 +23,7 @@ xmlns:atom="http://www.w3.org/2005/Atom">
<link href="/assets/img/favicon/favicon-32x32.png" rel="icon" type="image/png" sizes="32x32" /> <link href="/assets/img/favicon/favicon-32x32.png" rel="icon" type="image/png" sizes="32x32" />
<link href="/assets/img/favicon/apple-touch-icon.png" rel="apple-touch-icon" /> <link href="/assets/img/favicon/apple-touch-icon.png" rel="apple-touch-icon" />
<script src="https://breezy-restored.coryd.dev/script.js" data-site="RHNGSUXO">''</script> <script src="https://breezy-restored.coryd.dev/script.js" data-site="RHNGSUXO">''</script>
<script src="/assets/scripts/isDarkMode.js">''</script>
</head> </head>
<body class="dark:text-white dark:bg-gray-900 font-sans text-gray-800"> <body class="dark:text-white dark:bg-gray-900 font-sans text-gray-800">
<div class="min-h-screen flex flex-col"> <div class="min-h-screen flex flex-col">

View file

@ -0,0 +1,10 @@
;(function () {
const isDarkMode = () =>
localStorage.theme === 'dark' ||
(!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)
if (isDarkMode()) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
})()