Skip to content

Commit f0595cc

Browse files
committed
Split 'primary' color into functional colors (btn-primary, focus) - we
don't really have a brand color anyways, so this makes more sense
1 parent 0b313da commit f0595cc

14 files changed

+39
-38
lines changed

web/src/app.css

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
}
2020

2121
@theme {
22-
--color-primary: var(--color-blue-500);
22+
--color-btn-primary: var(--color-green-700);
23+
--color-focus: var(--color-blue-600);
2324

2425
/* Text colors */
2526
--color-em-high-light: rgba(0, 0, 0, 0.87);
@@ -93,8 +94,8 @@
9394
}
9495

9596
@utility btn-base {
96-
--btn-color: var(--color-primary);
97-
--btn-focus: var(--color-primary);
97+
--btn-color: var(--color-btn-primary);
98+
--btn-focus: var(--color-focus);
9899
--tw-shadow-color: color-mix(in oklab, var(--btn-color) 50%, transparent);
99100

100101
--btn-hover: color-mix(in oklch, var(--btn-color), black 5%);
@@ -133,11 +134,7 @@
133134

134135
@utility btn-fill-primary {
135136
@apply btn-fill text-white;
136-
--btn-color: var(--color-primary);
137-
--btn-focus: var(--color-neutral-800);
138-
@variant dark {
139-
--btn-focus: var(--color-neutral-100);
140-
}
137+
--btn-color: var(--color-btn-primary);
141138
}
142139

143140
@utility btn-fill-neutral {

web/src/lib/components/InfoPopup.svelte

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
</script>
66

77
<Popover.Root>
8-
<Popover.Trigger title="Information" class="flex size-6 btn-link items-center justify-center self-center p-0.5 data-[state=open]:btn-link-hover">
8+
<Popover.Trigger
9+
title="Information"
10+
class="flex size-6 btn-link items-center justify-center self-center rounded-sm p-0.5 ring-focus focus:outline-none focus-visible:ring-2 data-[state=open]:btn-link-hover"
11+
>
912
<span aria-hidden="true" class="iconify size-4 octicon--info-16"></span>
1013
</Popover.Trigger>
1114
<Popover.Portal>
12-
<Popover.Content class="z-50 mx-2 max-w-64 rounded-sm border bg-neutral px-2 py-1 text-sm">
15+
<Popover.Content class="z-50 mx-2 max-w-64 rounded-sm border bg-neutral px-2 py-1 text-sm ring-focus focus:outline-none focus-visible:ring-2">
1316
{@render children?.()}
1417
<Popover.Arrow class="text-edge" />
1518
</Popover.Content>

web/src/lib/components/LabeledCheckbox.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{labelText}
1919
</Label.Root>
2020
<div
21-
class="relative size-5 rounded-sm border bg-neutral transition-colors ease-in-out data-[state=checked]:bg-primary"
21+
class="relative size-5 rounded-sm border bg-neutral transition-colors ease-in-out data-[state=checked]:bg-blue-500"
2222
data-state={checked ? "checked" : "unchecked"}
2323
>
2424
<span

web/src/lib/components/Spinner.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
let mergedProps = $derived(
1212
mergeProps(
1313
{
14-
class: "animate-spin rounded-full border-b-2 border-primary",
14+
class: "animate-spin rounded-full border-2 border-em-disabled border-b-em-high",
1515
style: {
1616
height: `${size * 0.25}rem`,
1717
width: `${size * 0.25}rem`,

web/src/lib/components/diff/ImageDiff.svelte

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,8 @@
5656
</script>
5757

5858
{#snippet modeButton(forMode: Mode, iconClass: string)}
59-
<RadioGroup.Item
60-
value={forMode}
61-
class="flex items-center justify-center rounded-sm btn-ghost px-2 py-1 text-primary data-[state=checked]:btn-ghost-visible"
62-
>
63-
<span class="iconify {iconClass} me-1 size-4" aria-hidden="true"></span>{forMode}
59+
<RadioGroup.Item value={forMode} class="flex items-center justify-center rounded-sm btn-ghost px-2 py-1 data-[state=checked]:btn-ghost-visible">
60+
<span class="iconify {iconClass} me-1 size-4 text-em-med" aria-hidden="true"></span>{forMode}
6461
</RadioGroup.Item>
6562
{/snippet}
6663

@@ -152,7 +149,7 @@
152149
<div class="sticky bottom-4 mt-4 flex w-full max-w-[280px] items-center rounded-lg bg-neutral p-2.5 shadow-sm">
153150
<Slider.Root type="single" thumbPositioning="exact" bind:value={fadePercent} class="relative flex w-full touch-none items-center select-none">
154151
<span class="relative h-0.5 w-full grow cursor-pointer overflow-hidden rounded-full bg-em-disabled">
155-
<Slider.Range class="absolute h-full bg-primary" />
152+
<Slider.Range class="absolute h-full bg-em-high" />
156153
</span>
157154
<Slider.Thumb index={0} class="block size-4 cursor-pointer rounded-full border bg-neutral shadow-sm transition-colors data-active:scale-[0.95]" />
158155
</Slider.Root>

web/src/lib/components/files/FileTypeSelect.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<Select.Group>
7171
<Select.Item
7272
value="auto"
73-
class="cursor-default rounded-sm border px-2 py-1 text-sm data-highlighted:bg-neutral-3 data-selected:bg-primary data-selected:text-white"
73+
class="cursor-default rounded-sm border px-2 py-1 text-sm data-highlighted:bg-neutral-3 data-selected:bg-blue-500 data-selected:text-white"
7474
>
7575
Infer Type
7676
</Select.Item>
@@ -80,7 +80,7 @@
8080
{#each languages as lang (lang.id)}
8181
<Select.Item
8282
value={lang.id}
83-
class="group flex cursor-default flex-col px-2 py-1 text-sm data-highlighted:bg-neutral-3 data-selected:bg-primary data-selected:text-white"
83+
class="group flex cursor-default flex-col px-2 py-1 text-sm data-highlighted:bg-neutral-3 data-selected:bg-blue-500 data-selected:text-white"
8484
>
8585
{lang.name}
8686
<span class="text-sm font-light text-em-med group-data-selected:text-white/80">{lang.aliases.join(", ")}</span>

web/src/lib/components/files/MultimodalFileInput.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
{#snippet radioItem(name: string)}
8080
<RadioGroup.Item
8181
value={name.toLowerCase()}
82-
class="rounded-sm px-2 text-sm ring-primary hover:bg-neutral/65 focus:outline-none focus-visible:ring-2 data-[state=checked]:bg-neutral data-[state=checked]:shadow-sm"
82+
class="rounded-sm px-2 text-sm ring-focus hover:bg-neutral/65 focus:outline-none focus-visible:ring-2 data-[state=checked]:bg-neutral data-[state=checked]:shadow-sm"
8383
>
8484
{name}
8585
</RadioGroup.Item>
@@ -123,7 +123,7 @@
123123
placeholder="Enter file URL"
124124
type="url"
125125
{required}
126-
class="w-full rounded-md border bg-neutral px-2 py-1 inset-shadow-xs ring-primary focus:outline-none focus-visible:ring-2"
126+
class="w-full rounded-md border bg-neutral px-2 py-1 inset-shadow-xs ring-focus focus:outline-none focus-visible:ring-2"
127127
/>
128128
{/snippet}
129129

@@ -133,7 +133,7 @@
133133
bind:value={instance.text}
134134
placeholder="Enter text here"
135135
{required}
136-
class="w-full rounded-md border bg-neutral px-2 py-1 inset-shadow-xs ring-primary focus:outline-none focus-visible:ring-2"
136+
class="w-full rounded-md border bg-neutral px-2 py-1 inset-shadow-xs ring-focus focus:outline-none focus-visible:ring-2"
137137
></textarea>
138138
{/snippet}
139139

@@ -157,7 +157,7 @@
157157
158158
background-color: rgba(255, 255, 255, 0.7);
159159
160-
border: dashed var(--color-primary);
160+
border: dashed var(--color-focus);
161161
border-radius: inherit;
162162
}
163163
</style>

web/src/lib/components/progress-bar/ProgressBar.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
{@const percent = state.getPercent()}
2121
{#if percent !== undefined}
2222
<div
23-
class="h-full w-full rounded-full bg-primary drop-shadow-sm drop-shadow-primary/50 transition-all duration-50 ease-in-out will-change-transform"
23+
class="h-full w-full rounded-full bg-em-high drop-shadow-sm transition-all duration-50 ease-in-out will-change-transform"
2424
style={`transform: translateX(-${100 - percent}%)`}
2525
></div>
2626
{:else}
27-
<div id="spinner" class="h-full w-[20%] rounded-full bg-primary drop-shadow-sm drop-shadow-primary/50"></div>
27+
<div id="spinner" class="h-full w-[20%] rounded-full bg-em-high drop-shadow-sm"></div>
2828
{/if}
2929
</Progress.Root>
3030

web/src/lib/components/settings/ShikiThemeSelector.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
</script>
2020

2121
<Select.Root type="single" scrollAlignment="center" bind:value>
22-
<Select.Trigger aria-labelledby={labelId} id={triggerId} class="group flex cursor-pointer items-center justify-between gap-1 px-2 py-1">
22+
<Select.Trigger
23+
aria-labelledby={labelId}
24+
id={triggerId}
25+
class="group flex cursor-pointer items-center justify-between gap-1 px-2 py-1 ring-focus focus:outline-none focus-visible:ring-2"
26+
>
2327
<Label.Root id={labelId} for={triggerId} class="cursor-pointer">{capitalizeFirstLetter(mode)} theme</Label.Root>
2428
<div
2529
class="flex w-44 items-center gap-1 rounded-sm border btn-ghost bg-neutral px-2 py-0.5 text-sm select-none group-hover:btn-ghost-hover group-active:btn-ghost-active"
@@ -43,7 +47,7 @@
4347
{#each Object.keys(bundledThemes) as theme (theme)}
4448
<Select.Item
4549
value={theme}
46-
class="cursor-default rounded-sm px-2 py-1 text-sm data-highlighted:bg-neutral-3 data-selected:bg-primary data-selected:text-white"
50+
class="cursor-default rounded-sm px-2 py-1 text-sm data-highlighted:bg-neutral-3 data-selected:bg-blue-500 data-selected:text-white"
4751
>
4852
{theme}
4953
</Select.Item>

web/src/lib/components/settings/SimpleRadioGroup.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
>
2626
{#snippet children({ checked })}
2727
{#if checked}
28-
<span class="size-2.5 rounded-full bg-primary" aria-hidden="true"></span>
28+
<span class="size-2.5 rounded-full bg-blue-500" aria-hidden="true"></span>
2929
{/if}
3030
{/snippet}
3131
</RadioGroup.Item>

0 commit comments

Comments
 (0)