fix: wrap theme provider in self-invoking function

This commit is contained in:
Stefan Imhoff
2023-06-22 17:23:26 +02:00
parent db20b50c98
commit 09e6b1e672

View File

@@ -2,6 +2,7 @@
---
<script is:inline>
(function () {
const getThemePreference = () => {
if (typeof localStorage !== 'undefined' && localStorage.getItem('theme')) {
return localStorage.getItem('theme');
@@ -23,4 +24,5 @@
attributeFilter: ['class'],
});
}
})();
</script>