diff --git a/package-lock.json b/package-lock.json index 23137d0..18f69d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,8 @@ "name": "deprived-main-website", "version": "0.0.1", "dependencies": { - "svelte-media-queries": "^1.6.2" + "svelte-media-queries": "^1.6.2", + "theme-change": "^2.5.0" }, "devDependencies": { "@poppanator/sveltekit-svg": "^4.2.1", @@ -4651,6 +4652,11 @@ "b4a": "^1.6.4" } }, + "node_modules/theme-change": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/theme-change/-/theme-change-2.5.0.tgz", + "integrity": "sha512-B/UdsgdHAGhSKHTAQnxg/etN0RaMDpehuJmZIjLMDVJ6DGIliRHGD6pODi1CXLQAN9GV0GSyB3G6yCuK05PkPQ==" + }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", diff --git a/package.json b/package.json index 4e0804f..f34b869 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ }, "type": "module", "dependencies": { - "svelte-media-queries": "^1.6.2" + "svelte-media-queries": "^1.6.2", + "theme-change": "^2.5.0" } } diff --git a/src/app.html b/src/app.html index d385a62..2007a08 100644 --- a/src/app.html +++ b/src/app.html @@ -1,5 +1,5 @@ - + diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index a5331b5..52f0f80 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -28,10 +28,13 @@ }); import { onMount } from 'svelte'; + import { themeChange } from 'theme-change' onMount(() => { const lock = document.createElement('meta'); lock.name = 'darkreader-lock'; document.head.appendChild(lock); + + themeChange(false) // false parameter is required for svelte }); @@ -50,6 +53,26 @@

The Deprived Devs