Add announce preference to settings

This commit is contained in:
Rūdolfs Ošiņš
2024-10-25 10:46:53 +02:00
parent c01a48939e
commit 0693f4f806
4 changed files with 138 additions and 32 deletions
+27 -23
View File
@@ -28,13 +28,20 @@
<script lang="ts">
import { writable } from "svelte/store";
import Border from "./Border.svelte";
import Icon from "./Icon.svelte";
</script>
<style>
.container {
background-color: var(--color-fill-ghost);
clip-path: var(--2px-corner-fill);
display: flex;
height: 32px;
align-items: center;
padding: 0 2px;
}
button {
height: 28px;
cursor: pointer;
display: flex;
align-items: center;
@@ -42,40 +49,37 @@
white-space: nowrap;
touch-action: manipulation;
clip-path: var(--1px-corner-fill);
height: 24px;
font-size: var(--font-size-small);
margin: 0;
padding: 0 1rem;
color: var(--color-foreground-contrast);
background-color: var(--color-fill-ghost);
font-weight: var(--font-weight-semibold);
gap: 6px;
}
.active {
color: var(--color-foreground-emphasized);
background-color: var(--color-background-dip);
}
</style>
<Border variant="secondary">
<div class="container">
<button
style:background-color={$theme === "dark"
? "var(--color-fill-secondary)"
: "transparent"}
class:active={$theme === "dark"}
onclick={() => {
storeTheme("dark");
}}>
<span style="display: flex; align-items: center; gap: 0.5rem">
<Icon name="moon" />
Dark
</span>
<Icon name="moon" />
Dark
</button>
<button
style:background-color={$theme === "light"
? "var(--color-fill-secondary)"
: "transparent"}
class:active={$theme === "light"}
onclick={() => {
storeTheme("light");
}}>
<span
style="display: flex; align-items: center; gap: 0.5rem"
style:color={$theme === "light"
? "var(--color-foreground-white)"
: "var(--color-foreground-contrast)"}>
<Icon name="sun" />
Light
</span>
<Icon name="sun" />
Light
</button>
</Border>
</div>