Skip to content

Commit

Permalink
chore: merged 'rugk-fork/autodarkmode' into mundanevision20-python3-m…
Browse files Browse the repository at this point in the history
…igration
  • Loading branch information
mundanevision20 authored Sep 21, 2024
2 parents 8fbd699 + a4ac247 commit 14e89ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions explainshell/web/static/js/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,11 @@ function setTheme(theme) {

// Theme-related stuff
$(document).ready(function() {
// use theme from local storage or auto-detect otherwise
var selectedTheme = localStorage.getItem('theme')
|| (window.matchMedia("(prefers-color-scheme: dark)").matches ? 'dark' : 'default')
|| 'default';

if (!docCookies.getItem(themeCookieName)) {
var selectedTheme = 'default';
setTheme(selectedTheme); // to set the correct css file and data-theme
Expand Down

0 comments on commit 14e89ef

Please sign in to comment.