mirror of
https://github.com/FoxxMD/context-mod.git
synced 2026-01-13 07:37:53 -05:00
Set dark theme as default
This commit is contained in:
@@ -63,13 +63,13 @@
|
||||
z-index: 100;
|
||||
}
|
||||
</style>
|
||||
<title>RCB for <%= botName %></title>
|
||||
<title>RCB for /u/<%= botName %></title>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
</head>
|
||||
<body class="">
|
||||
<script>localStorage.getItem('ms-dark') === 'yes' ? document.body.classList.add('dark') : document.body.classList.remove('dark')</script>
|
||||
<script>localStorage.getItem('ms-dark') === 'no' ? document.body.classList.remove('dark') : document.body.classList.add('dark')</script>
|
||||
<div class="min-w-screen min-h-screen bg-gray-100 bg-gray-100 dark:bg-gray-800 font-sans">
|
||||
<div class="space-x-4 p-6 md:px-10 md:py-6 leading-6 font-semibold bg-gray-800 text-white">
|
||||
<div class="container mx-auto">
|
||||
@@ -338,16 +338,12 @@
|
||||
e.target.classList.add('font-bold', 'no-underline', 'pointer-events-none');
|
||||
})
|
||||
})
|
||||
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
if (localStorage.getItem('ms-dark') === 'yes') {
|
||||
document.body.classList.add('dark')
|
||||
document.querySelector('#dark.theme').classList.add('font-bold', 'no-underline', 'pointer-events-none');
|
||||
localStorage.setItem('ms-dark', 'yes')
|
||||
} else {
|
||||
document.querySelector('#light.theme').classList.add('font-bold', 'no-underline', 'pointer-events-none');
|
||||
}
|
||||
} else {
|
||||
|
||||
if (localStorage.getItem('ms-dark') === 'no') {
|
||||
document.querySelector('#light.theme').classList.add('font-bold', 'no-underline', 'pointer-events-none');
|
||||
document.body.classList.remove('dark')
|
||||
} else {
|
||||
document.querySelector('#dark.theme').classList.add('font-bold', 'no-underline', 'pointer-events-none');
|
||||
}
|
||||
|
||||
document.querySelector('.log-info').addEventListener('click', e => {
|
||||
|
||||
Reference in New Issue
Block a user