vega-frontend-monorepo/apps/trading/public/theme-setter.js

10 lines
258 B
JavaScript

(function () {
var storedTheme = window.localStorage.getItem('theme');
if (
storedTheme === 'dark' ||
(!storedTheme && window.matchMedia('(prefers-color-scheme: dark)').matches)
) {
document.documentElement.classList.add('dark');
}
})();