Skip to content

Commit 046ca06

Browse files
backnotpropclaude
andauthored
feat: improve dark mode contrast and add success/warning tokens (#54)
- Lift background from 13% to 15% lightness (softer than pure black) - Soften foreground from 95% to 90% (reduces glare) - Increase surface elevation separation (card 22%, popover 28%) - Make muted-foreground more readable (65% → 72%) - Make borders more visible (28% → 35%) - Add --success and --warning design tokens - Replace all hardcoded Tailwind colors (green-500, purple-500, yellow-500) with design tokens for consistent theming - Boost annotation highlight opacity in dark mode for better readability Closes #53 Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c9a42af commit 046ca06

7 files changed

Lines changed: 52 additions & 31 deletions

File tree

packages/editor/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,8 @@ const App: React.FC = () => {
627627
isSubmitting
628628
? 'opacity-50 cursor-not-allowed bg-muted text-muted-foreground'
629629
: origin === 'claude-code' && annotations.length > 0
630-
? 'bg-green-600/50 text-white/70 hover:bg-green-600 hover:text-white'
631-
: 'bg-green-600 text-white hover:bg-green-500'
630+
? 'bg-success/50 text-success-foreground/70 hover:bg-success hover:text-success-foreground'
631+
: 'bg-success text-success-foreground hover:opacity-90'
632632
}`}
633633
>
634634
<span className="md:hidden">{isSubmitting ? '...' : 'OK'}</span>
@@ -769,7 +769,7 @@ const App: React.FC = () => {
769769
<div className="text-center space-y-6 max-w-md px-8">
770770
<div className={`mx-auto w-16 h-16 rounded-full flex items-center justify-center ${
771771
submitted === 'approved'
772-
? 'bg-green-500/20 text-green-500'
772+
? 'bg-success/20 text-success'
773773
: 'bg-accent/20 text-accent'
774774
}`}>
775775
{submitted === 'approved' ? (

packages/editor/index.css

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,29 @@
66
@source "./*.tsx";
77
88
:root {
9-
--background: oklch(0.13 0.02 260);
10-
--foreground: oklch(0.95 0.01 260);
11-
--card: oklch(0.16 0.02 260);
12-
--card-foreground: oklch(0.95 0.01 260);
13-
--popover: oklch(0.18 0.025 260);
14-
--popover-foreground: oklch(0.95 0.01 260);
9+
--background: oklch(0.15 0.02 260);
10+
--foreground: oklch(0.90 0.01 260);
11+
--card: oklch(0.22 0.02 260);
12+
--card-foreground: oklch(0.90 0.01 260);
13+
--popover: oklch(0.28 0.025 260);
14+
--popover-foreground: oklch(0.90 0.01 260);
1515
--primary: oklch(0.75 0.18 280);
16-
--primary-foreground: oklch(0.13 0.02 260);
16+
--primary-foreground: oklch(0.15 0.02 260);
1717
--secondary: oklch(0.65 0.15 180);
18-
--secondary-foreground: oklch(0.13 0.02 260);
19-
--muted: oklch(0.22 0.02 260);
20-
--muted-foreground: oklch(0.65 0.02 260);
18+
--secondary-foreground: oklch(0.15 0.02 260);
19+
--muted: oklch(0.26 0.02 260);
20+
--muted-foreground: oklch(0.72 0.02 260);
2121
--accent: oklch(0.70 0.20 60);
22-
--accent-foreground: oklch(0.13 0.02 260);
23-
--destructive: oklch(0.65 0.22 25);
22+
--accent-foreground: oklch(0.15 0.02 260);
23+
--destructive: oklch(0.65 0.20 25);
2424
--destructive-foreground: oklch(0.98 0 0);
25-
--border: oklch(0.28 0.02 260);
26-
--input: oklch(0.22 0.02 260);
25+
--border: oklch(0.35 0.02 260);
26+
--input: oklch(0.26 0.02 260);
2727
--ring: oklch(0.75 0.18 280);
28+
--success: oklch(0.72 0.17 150);
29+
--success-foreground: oklch(0.15 0.02 260);
30+
--warning: oklch(0.75 0.15 85);
31+
--warning-foreground: oklch(0.20 0.02 260);
2832
2933
--font-sans: 'Inter', system-ui, sans-serif;
3034
--font-mono: 'JetBrains Mono', 'Fira Code', monospace;
@@ -51,6 +55,10 @@
5155
--border: oklch(0.88 0.01 260);
5256
--input: oklch(0.92 0.01 260);
5357
--ring: oklch(0.50 0.25 280);
58+
--success: oklch(0.45 0.20 150);
59+
--success-foreground: oklch(1 0 0);
60+
--warning: oklch(0.55 0.18 85);
61+
--warning-foreground: oklch(0.18 0.02 260);
5462
}
5563
5664
@theme inline {
@@ -70,6 +78,10 @@
7078
--color-accent-foreground: var(--accent-foreground);
7179
--color-destructive: var(--destructive);
7280
--color-destructive-foreground: var(--destructive-foreground);
81+
--color-success: var(--success);
82+
--color-success-foreground: var(--success-foreground);
83+
--color-warning: var(--warning);
84+
--color-warning-foreground: var(--warning-foreground);
7385
--color-border: var(--border);
7486
--color-input: var(--input);
7587
--color-ring: var(--ring);
@@ -95,8 +107,8 @@ body {
95107
/* Subtle grid background */
96108
.bg-grid {
97109
background-image:
98-
linear-gradient(to right, oklch(0.25 0.02 260 / 0.5) 1px, transparent 1px),
99-
linear-gradient(to bottom, oklch(0.25 0.02 260 / 0.5) 1px, transparent 1px);
110+
linear-gradient(to right, oklch(0.32 0.02 260 / 0.5) 1px, transparent 1px),
111+
linear-gradient(to bottom, oklch(0.32 0.02 260 / 0.5) 1px, transparent 1px);
100112
background-size: 24px 24px;
101113
}
102114

@@ -201,17 +213,26 @@ pre code.hljs {
201213
}
202214

203215
.annotation-highlight.deletion {
204-
background: oklch(0.65 0.22 25 / 0.25);
216+
background: oklch(0.65 0.20 25 / 0.35);
205217
text-decoration: line-through;
206218
text-decoration-color: var(--destructive);
207219
text-decoration-thickness: 2px;
208220
}
209221

210222
.annotation-highlight.comment {
211-
background: oklch(0.70 0.20 60 / 0.2);
223+
background: oklch(0.70 0.18 60 / 0.3);
212224
border-bottom: 2px solid var(--accent);
213225
}
214226

227+
/* Light mode: softer highlights */
228+
.light .annotation-highlight.deletion {
229+
background: oklch(0.65 0.22 25 / 0.2);
230+
}
231+
232+
.light .annotation-highlight.comment {
233+
background: oklch(0.70 0.20 60 / 0.15);
234+
}
235+
215236
.annotation-highlight:hover {
216237
filter: brightness(1.2);
217238
cursor: pointer;

packages/ui/components/AnnotationPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ const AnnotationCard: React.FC<{
172172
},
173173
[AnnotationType.GLOBAL_COMMENT]: {
174174
label: 'Global',
175-
color: 'text-purple-500',
176-
bg: 'bg-purple-500/10',
175+
color: 'text-secondary',
176+
bg: 'bg-secondary/10',
177177
icon: (
178178
<svg className="w-3 h-3" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
179179
<path strokeLinecap="round" strokeLinejoin="round" d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" />

packages/ui/components/AnnotationToolbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export const AnnotationToolbar: React.FC<AnnotationToolbarProps> = ({
162162
onClick={handleCopy}
163163
icon={copied ? <CheckIcon /> : <CopyIcon />}
164164
label={copied ? "Copied!" : "Copy"}
165-
className={copied ? "text-green-500" : "text-muted-foreground hover:bg-muted hover:text-foreground"}
165+
className={copied ? "text-success" : "text-muted-foreground hover:bg-muted hover:text-foreground"}
166166
/>
167167
<div className="w-px h-5 bg-border mx-0.5" />
168168
<ToolbarButton

packages/ui/components/ConfirmDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ export const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
3333

3434
const iconColors = {
3535
info: 'bg-accent/20 text-accent',
36-
warning: 'bg-yellow-500/20 text-yellow-500',
36+
warning: 'bg-warning/20 text-warning',
3737
};
3838

3939
const buttonColors = {
4040
info: 'bg-primary text-primary-foreground hover:opacity-90',
41-
warning: 'bg-yellow-600 text-white hover:bg-yellow-500',
41+
warning: 'bg-warning text-warning-foreground hover:opacity-90',
4242
};
4343

4444
const icons = {

packages/ui/components/ImageAnnotator/Toolbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export const Toolbar: React.FC<ToolbarProps> = ({
209209
type="button"
210210
onClick={onSave}
211211
title="Save (Esc)"
212-
className="p-1.5 rounded transition-colors bg-green-600 text-white hover:bg-green-500"
212+
className="p-1.5 rounded transition-colors bg-success text-success-foreground hover:opacity-90"
213213
>
214214
<CheckIcon />
215215
</button>

packages/ui/components/Viewer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ export const Viewer = forwardRef<ViewerHandle, ViewerProps>(({
606606
<button
607607
type="submit"
608608
disabled={!globalCommentValue.trim()}
609-
className="self-start px-2 py-1.5 text-xs font-medium rounded bg-purple-600 text-white hover:bg-purple-500 disabled:opacity-50 transition-all"
609+
className="self-start px-2 py-1.5 text-xs font-medium rounded bg-secondary text-secondary-foreground hover:opacity-90 disabled:opacity-50 transition-all"
610610
>
611611
Add
612612
</button>
@@ -644,7 +644,7 @@ export const Viewer = forwardRef<ViewerHandle, ViewerProps>(({
644644
>
645645
{copied ? (
646646
<>
647-
<svg className="w-3.5 h-3.5 text-green-500" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
647+
<svg className="w-3.5 h-3.5 text-success" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
648648
<path strokeLinecap="round" strokeLinejoin="round" d="M5 13l4 4L19 7" />
649649
</svg>
650650
<span className="hidden md:inline">Copied!</span>
@@ -872,7 +872,7 @@ const BlockRenderer: React.FC<{ block: Block }> = ({ block }) => {
872872
<span className="select-none shrink-0 flex items-center">
873873
{isCheckbox ? (
874874
block.checked ? (
875-
<svg className="w-4 h-4 text-green-500" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2.5}>
875+
<svg className="w-4 h-4 text-success" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2.5}>
876876
<path strokeLinecap="round" strokeLinejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
877877
</svg>
878878
) : (
@@ -999,7 +999,7 @@ const CodeBlock: React.FC<CodeBlockProps> = ({ block, onHover, onLeave, isHovere
999999
title={copied ? 'Copied!' : 'Copy code'}
10001000
>
10011001
{copied ? (
1002-
<svg className="w-4 h-4 text-green-500" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
1002+
<svg className="w-4 h-4 text-success" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
10031003
<path strokeLinecap="round" strokeLinejoin="round" d="M5 13l4 4L19 7" />
10041004
</svg>
10051005
) : (

0 commit comments

Comments
 (0)