✨ feat: add light theme
can be accessed using the theme query param (eg `?theme=system`)
This commit is contained in:
+8
-1
@@ -18,11 +18,18 @@ import theme from 'style/theme.js'
|
||||
import App from './App.js'
|
||||
import './index.css'
|
||||
|
||||
const themeParam = new URLSearchParams(window.location.search).get('theme')
|
||||
let mode: 'light' | 'dark' | 'system' = 'dark'
|
||||
|
||||
if (themeParam === 'light' || themeParam === 'dark' || themeParam === 'system') {
|
||||
mode = themeParam
|
||||
}
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<AnalyticsProvider instance={analytics}>
|
||||
<ThemeProvider theme={theme}>
|
||||
<ThemeProvider theme={theme} defaultMode={mode}>
|
||||
<CssBaseline />
|
||||
<App />
|
||||
</ThemeProvider>
|
||||
|
||||
Reference in New Issue
Block a user