From 1bb5d3ecb0b8c4d53362eaf19511a964e59c48b6 Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Wed, 5 May 2021 10:42:37 +0200 Subject: [PATCH] ios appearance and theme override --- client/src/app.css | 45 ++++++++++++------ client/src/lib/ui/ThemeToggle.svelte | 63 ++++++++++++++++++++++++++ client/src/lib/views/Footer.svelte | 37 +++++++++++++++ client/src/lib/views/Header.svelte | 2 +- client/src/routes/$layout.svelte | 23 +--------- client/static/icons/contrast-sharp.svg | 1 + 6 files changed, 136 insertions(+), 35 deletions(-) create mode 100644 client/src/lib/ui/ThemeToggle.svelte create mode 100644 client/src/lib/views/Footer.svelte create mode 100644 client/static/icons/contrast-sharp.svg diff --git a/client/src/app.css b/client/src/app.css index cb534ee..15f25e4 100644 --- a/client/src/app.css +++ b/client/src/app.css @@ -7,29 +7,46 @@ :root { font-family: 'Fira Mono', monospace; - --ui-bg-0: #fefefe; - --ui-bg-0-85: #fefefed9; - --ui-bg-1: #eee; - --ui-bg-2: #e2e2e2; - --ui-text-0: #111; - --ui-text-1: #222; + --ui-bg-0: #111; + --ui-bg-0-85: #111111d9; + --ui-bg-1: #333; + --ui-bg-2: #444; + --ui-text-0: #fefefe; + --ui-text-1: #eee; --ui-clr-primary: hsl(186, 65%, 55%); --ui-clr-error: hsl(357, 77%, 51%); --ui-anim: all 150ms ease; } -@media (prefers-color-scheme: dark) { +@media (prefers-color-scheme: light) { :root { - --ui-bg-0: #111; - --ui-bg-0-85: #111111d9; - --ui-bg-1: #222; - --ui-bg-2: #282828; - --ui-text-0: #fefefe; - --ui-text-1: #eee; + --ui-bg-0: #fefefe; + --ui-bg-0-85: #fefefed9; + --ui-bg-1: #eee; + --ui-bg-2: #e2e2e2; + --ui-text-0: #111; + --ui-text-1: #333; } } +:root[theme='dark'] { + --ui-bg-0: #111 !important; + --ui-bg-0-85: #111111d9 !important; + --ui-bg-1: #333 !important; + --ui-bg-2: #444 !important; + --ui-text-0: #fefefe !important; + --ui-text-1: #eee !important; +} +:root[theme='light'] { + --ui-bg-0: #fefefe !important; + --ui-bg-0-85: #fefefed9 !important; + --ui-bg-1: #eee !important; + --ui-bg-2: #e2e2e2 !important; + --ui-text-0: #111 !important; + --ui-text-1: #333 !important; +} + .error-text { color: var(--ui-clr-error); } @@ -61,6 +78,8 @@ input, textarea, button { appearance: none; + -webkit-appearance: none; + border-radius: 0; transition: var(--ui-anim); font-family: inherit; font-size: inherit; diff --git a/client/src/lib/ui/ThemeToggle.svelte b/client/src/lib/ui/ThemeToggle.svelte new file mode 100644 index 0000000..4405594 --- /dev/null +++ b/client/src/lib/ui/ThemeToggle.svelte @@ -0,0 +1,63 @@ + + + + +
+ + {$theme} +
+ + diff --git a/client/src/lib/views/Footer.svelte b/client/src/lib/views/Footer.svelte new file mode 100644 index 0000000..d2172a8 --- /dev/null +++ b/client/src/lib/views/Footer.svelte @@ -0,0 +1,37 @@ + + + + + diff --git a/client/src/lib/views/Header.svelte b/client/src/lib/views/Header.svelte index 80e6cc7..323d854 100644 --- a/client/src/lib/views/Header.svelte +++ b/client/src/lib/views/Header.svelte @@ -8,7 +8,6 @@ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" - xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;" > diff --git a/client/src/routes/$layout.svelte b/client/src/routes/$layout.svelte index a31fc11..2f9506f 100644 --- a/client/src/routes/$layout.svelte +++ b/client/src/routes/$layout.svelte @@ -1,4 +1,5 @@