theme-switch: Improve theme switch logic (#86)

- removes unnecessary local-storage item removal
- less inline script on build
- assumes `defaultTheme as auto when value is not `dark` or `light`
- should work according to table at docs
This commit is contained in:
Aditya Telange authored and GitHub committed 2020-11-26 09:10:24 +05:30
1 parent 678b5d82fc
commit b301d60f03
2 files changed
+16 -16

No files matched your search

-6
View File
@@ -64,11 +64,5 @@
}
})
</script>
{{- else -}}
{{/* case where owner disables theme button after deployment, this resets the stored theme */}}
<script>
localStorage.removeItem("pref-theme");
</script>
{{- end }}