accept `/?__theme=dark`
Browse files
src/routes/+layout.svelte
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
<script>
|
2 |
import "../app.css";
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
</script>
|
4 |
|
5 |
<slot></slot>
|
|
|
1 |
<script>
|
2 |
import "../app.css";
|
3 |
+
import { browser } from '$app/environment';
|
4 |
+
import { page } from '$app/stores';
|
5 |
+
|
6 |
+
$: if (browser && $page.url.searchParams.get('__theme') === 'dark') {
|
7 |
+
document.documentElement.classList.add('dark');
|
8 |
+
}
|
9 |
</script>
|
10 |
|
11 |
<slot></slot>
|