mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 05:05:53 +00:00
Use the light theme when no theme is supplied
This commit is contained in:
parent
82e3e72037
commit
c1a55ade7c
@ -89,13 +89,12 @@
|
||||
<body class="app-body">
|
||||
<script type="text/javascript">
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const theme = urlParams.get("theme") || "light";
|
||||
let theme = urlParams.get("theme");
|
||||
const allowedThemes = ["dark", "light"];
|
||||
if (theme && allowedThemes.indexOf(theme) !== -1) {
|
||||
const body = document.getElementsByTagName("body");
|
||||
for (const element of body) {
|
||||
element.className += " theme-" + theme;
|
||||
}
|
||||
if (allowedThemes.indexOf(theme) === -1) theme = "light";
|
||||
const body = document.getElementsByTagName("body");
|
||||
for (const element of body) {
|
||||
element.className += " theme-" + theme;
|
||||
}
|
||||
</script>
|
||||
<my-app class="main-app">
|
||||
|
Loading…
Reference in New Issue
Block a user