diff --git a/research/src/components/Dropdown.svelte b/research/src/components/Dropdown.svelte index 8f406c6..4b56fd0 100644 --- a/research/src/components/Dropdown.svelte +++ b/research/src/components/Dropdown.svelte @@ -1,5 +1,7 @@
-
-
- - +
+
diff --git a/research/src/components/MobileNav.svelte b/research/src/components/MobileNav.svelte index f91fc0f..e88a779 100644 --- a/research/src/components/MobileNav.svelte +++ b/research/src/components/MobileNav.svelte @@ -17,11 +17,12 @@ on:click={() => (open = false)} >
- (open = false)}>X
diff --git a/research/src/components/ToggleTheme.svelte b/research/src/components/ToggleTheme.svelte new file mode 100644 index 0000000..a408672 --- /dev/null +++ b/research/src/components/ToggleTheme.svelte @@ -0,0 +1,27 @@ + + + diff --git a/research/src/components/icons/ExternalLink.svelte b/research/src/components/icons/ExternalLink.svelte index 747719c..5e075fa 100644 --- a/research/src/components/icons/ExternalLink.svelte +++ b/research/src/components/icons/ExternalLink.svelte @@ -10,12 +10,13 @@ xmlns="http://www.w3.org/2000/svg" style:width={size} style:height={size} + class="text-current" > - - - + + + diff --git a/research/src/components/icons/Moon.svelte b/research/src/components/icons/Moon.svelte index dc6cf1a..8d2e06f 100644 --- a/research/src/components/icons/Moon.svelte +++ b/research/src/components/icons/Moon.svelte @@ -1,4 +1,14 @@ - + + + + export let size = '24px' + + - function myFunction() { - document.getElementById('myDropdown').classList.toggle('show') - } - - /**Dropdown menu logic */ - window.onclick = function (event) { - if (!event.target.matches('.dropbtn')) { - var dropdowns = document.getElementsByClassName('dropdown-content') - var i - for (i = 0; i < dropdowns.length; i++) { - var openDropdown = dropdowns[i] - if (openDropdown.classList.contains('show')) { - openDropdown.classList.remove('show') - } - } - } + // We need this script here to avoid flashing the light theme before the dark theme is applied + const theme = localStorage.getItem('theme') + if (theme === 'dark') { + document.documentElement.classList.add('dark') + } else { + document.documentElement.classList.remove('dark') } -
-
+
+