1
0
mirror of https://github.com/restoreddev/phpapprentice.git synced 2025-08-07 07:16:45 +02:00

Using css custom properties and moving dark mode js to top of page

This commit is contained in:
Andrew Davis
2020-02-03 18:11:22 -06:00
parent 5ed7a72db1
commit 56464d4ea8
7 changed files with 145 additions and 112 deletions

View File

@@ -1,9 +1,5 @@
// Dark mode
var bodyTag = document.querySelector('body');
if (localStorage.getItem('dark_mode') === 'true') {
bodyTag.className = 'dark-mode';
}
var darkMode = document.getElementById('dark_mode');
if (localStorage.getItem('dark_mode') === 'true') {
darkMode.checked = true;