Spaces:
Sleeping
Sleeping
André Oliveira commited on
Commit ·
dd2c243
1
Parent(s): da6a11f
Revert remove light mode fallback
Browse files2388 unmodified lines238923902391239223932394239523962397239823992400240124022392239323942395239623972398239924002401240224032404240524062407240824092388 unmodified lines# ---------------------------------------------------------------------------EARLY_THEME_JS = """(function() { var url = new URL(window.location.href); var isDark; console.log(window.matchMedia); if (url.searchParams.get('__theme') === 'dark') { isDark = url.searchParams.get('__theme') === 'dark'; } else { isDark = !!(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches); } if (isDark) { document.documentElement.classList.add('dark'); try { var url = new URL(window.location.href); var isDark; if (url.searchParams.get('__theme') === 'dark') { isDark = url.searchParams.get('__theme') === 'dark'; } else { isDark = !!(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches); } if (isDark) { document.documentElement.classList.add('dark'); } } catch (e) { // If anything above throws (e.g. matchMedia unavailable), just fall // back to the light-mode default rather than breaking the page. }})();"""app.py+15-11