(theme)
| 109 | } |
| 110 | |
| 111 | function setStoredTheme(theme) { |
| 112 | try { |
| 113 | localStorage.setItem(THEME_KEY, theme); |
| 114 | } catch (e) { |
| 115 | // ignore |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | function getSystemTheme() { |
| 120 | return (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) |