Use the light theme when no theme is supplied

This commit is contained in:
Travis Ralston 2018-10-22 01:16:55 -06:00
parent 82e3e72037
commit c1a55ade7c

View file

@ -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">