Skip to content

Commit

Permalink
Refactor dark mode implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
smcepeda committed Oct 2, 2023
1 parent ab7c1c3 commit dfad9f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client/src/lib/RainBar.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<script>
export let rainInMM;
let useDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches;
$: useDarkMode;
$: isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches;
</script>

<div class="h-[30px] w-full flex flex-col-reverse items-center relative mt-2">
<div
class="absolute w-full h-full"
style={useDarkMode
style={isDarkMode
? `background: linear-gradient(180deg, rgb(8, 81, 139), rgb(8, 81, 139) 1px, transparent 1%, transparent); background-size: 100% 5px;`
: `background: linear-gradient(180deg, rgba(0, 64, 114, 1), rgba(0, 64, 114, 1) 1px, transparent 1%, transparent); background-size: 100% 5px;`}
/>
Expand Down

0 comments on commit dfad9f6

Please sign in to comment.