✨ feat: add light theme

can be accessed using the theme query param
(eg `?theme=system`)
This commit is contained in:
2025-06-16 17:45:40 +02:00
committed by Michele Tartari
parent ca98e66206
commit e0c7314313
4 changed files with 111 additions and 28 deletions
+8 -1
View File
@@ -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>