Skip to content

Commit

Permalink
dark theme hard-coded again for now
Browse files Browse the repository at this point in the history
  • Loading branch information
matthme committed Aug 21, 2024
1 parent eba2b57 commit a16cd55
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/renderer/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@
%sveltekit.head%
<script>
const toggleTheme = (isDark) => document.documentElement.classList.toggle('dark', isDark);
const matchMediaDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)');

// For now always use dark theme as there is no proper light theme
toggleTheme(true);

// const matchMediaDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)');

// TODO(release-check): Fix colors in app to allow for light mode

// Set the default theme based on system preference with fallback to dark
toggleTheme(matchMediaDark ? matchMediaDark.matches : true);
// toggleTheme(matchMediaDark ? matchMediaDark.matches : true);

// Listen for changes to the color scheme
matchMediaDark && matchMediaDark.addEventListener('change', (e) => toggleTheme(e.matches));
// matchMediaDark && matchMediaDark.addEventListener('change', (e) => toggleTheme(e.matches));
</script>
</head>
<body data-sveltekit-preload-data="hover" data-theme="app-theme">
Expand Down

0 comments on commit a16cd55

Please sign in to comment.