Skip to content

Commit 69e4721

Browse files
authored
Merge pull request #30 from bherbst/dark_fixes
Dark & light mode color fixes
2 parents 889617a + 11414ad commit 69e4721

File tree

6 files changed

+15
-7
lines changed

6 files changed

+15
-7
lines changed

ui/src/app.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
--color-neutral-950: #0a0a0a;
1515
}
1616

17+
/* Allow setting dark mode manually instead of just relying on prefers-color-scheme */
18+
@custom-variant dark (&:where(.dark, .dark *));
19+
1720
html {
1821
font-feature-settings: normal;
1922
font-variation-settings: normal;

ui/src/lib/components/Button.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
2929
let colorClass = {
3030
none: '',
31-
primary: 'bg-primary-500 hover:bg-primary-600 text-white focus-visible:bg-primary-500',
31+
primary:
32+
'bg-primary-500 hover:bg-primary-600 text-gray-800 dark:text-white focus-visible:bg-primary-500',
3233
blue: `${styles.alliance.blue.primary} ${styles.alliance.blue.primaryHover} ${styles.alliance.blue.primaryFocus}`,
3334
red: `${styles.alliance.red.primary} ${styles.alliance.red.primaryHover} ${styles.alliance.red.primaryFocus}`,
3435
green: 'bg-green-500 hover:bg-green-600 text-white focus-visible:bg-green-500',

ui/src/lib/components/TextInput.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{...restProps}
2525
type="text"
2626
bind:value={text}
27-
class="block flex-1 rounded-md shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-indigo-600 py-1.5 px-2 text-gray-900 placeholder:text-gray-400"
27+
class="block flex-1 rounded-md shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-indigo-600 dark:focus:ring-indigo-300 py-1.5 px-2 text-gray-900 dark:text-white placeholder:text-gray-400"
2828
{placeholder}
2929
{onblur}
3030
/>

ui/src/lib/components/Toggle.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{...restProps}
2424
type="button"
2525
class="relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-2 {checked
26-
? 'bg-primary-600'
26+
? 'bg-blue-600'
2727
: 'bg-gray-200 dark:bg-neutral-600'}"
2828
role="switch"
2929
aria-checked={checked}

ui/src/routes/+layout.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@
9494
</div>
9595

9696
<!-- Sidebar component -->
97-
<div class="flex grow flex-col gap-y-5 overflow-y-auto bg-primary-600 text-white px-6 pb-2">
97+
<div
98+
class="flex grow flex-col gap-y-5 overflow-y-auto bg-primary-600 text-gray-900 dark:text-white px-6 pb-2"
99+
>
98100
<div class="flex h-16 shrink-0 items-center font-semibold text-xl">FTA Notepad</div>
99101
<nav class="flex flex-1 flex-col">
100102
<ul role="list" class="flex flex-1 flex-col gap-y-2">
@@ -147,7 +149,9 @@
147149
<!-- Static sidebar for desktop -->
148150
<div class="hidden lg:fixed lg:inset-y-0 lg:flex lg:w-72 lg:flex-col">
149151
<!-- Sidebar component -->
150-
<div class="flex grow flex-col gap-y-5 overflow-y-auto bg-primary-600 text-white px-6">
152+
<div
153+
class="flex grow flex-col gap-y-5 overflow-y-auto bg-primary-600 text-gray-900 dark:text-white px-6"
154+
>
151155
<div class="flex h-16 shrink-0 items-center font-semibold text-xl">FTA Notepad</div>
152156
<nav class="flex flex-1 flex-col">
153157
<ul role="list" class="flex flex-1 flex-col gap-y-2">

ui/src/routes/fieldMonitor/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@
102102
class="grid grid-cols-fieldmonitor lg:grid-cols-fieldmonitor-large gap-0.5 md:gap-1 mx-auto justify-center"
103103
>
104104
<div class="col-span-6 lg:col-span-8 flex text-lg md:text-2xl font-semibold">
105-
<div class="bg-neutral-700 px-2">M: {matchNumber}</div>
105+
<div class="bg-neutral-300 dark:bg-neutral-700 px-2">M: {matchNumber}</div>
106106
<div class="flex-1 bg-green-600 px-2 text-center">{matchStatusToString(matchStatus)}</div>
107-
<div class="bg-neutral-700 px-2">On Time</div>
107+
<div class="bg-neutral-300 dark:bg-neutral-700 px-2">On Time</div>
108108
</div>
109109
<MonitorRow monitorFrame={blue1} {detailView} />
110110
<MonitorRow monitorFrame={blue2} {detailView} />

0 commit comments

Comments
 (0)