Skip to content

Commit 42c16ff

Browse files
use accessible colors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0be4cf6 commit 42c16ff

6 files changed

Lines changed: 27 additions & 24 deletions

File tree

client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6-
<meta name="theme-color" content="#212121" />
6+
<meta name="theme-color" content="#ffffff" />
77
<title>Safe-Lens</title>
88
</head>
99
<body class="bg-bg text-fg font-mono">

client/src/App.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export default function App() {
6060
document.documentElement.classList.remove("dark");
6161
}
6262
localStorage.setItem("theme", isDark ? "dark" : "light");
63+
const meta = document.querySelector('meta[name="theme-color"]');
64+
if (meta) meta.setAttribute("content", isDark ? "#09090b" : "#ffffff");
6365
}, [isDark]);
6466

6567
const [prompt, setPrompt] = useState("");

client/src/components/Barplot.jsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ export default function Barplot({ data, onTickClick, disabled }) {
8181
const tickFontSize = Math.min(15, Math.max(5, yScale.bandwidth() * 0.9));
8282
yAxis
8383
.selectAll("text")
84-
.attr("fill", "#f5f6fa")
8584
.style("font-size", `${tickFontSize}px`)
8685
.style("font-weight", "500");
8786

@@ -119,8 +118,7 @@ export default function Barplot({ data, onTickClick, disabled }) {
119118
.attr("y", (d) => yScale(d.text))
120119
.attr("x", 0)
121120
.attr("height", yScale.bandwidth())
122-
.attr("width", (d) => xScale(d.prob))
123-
.attr("fill", "white");
121+
.attr("width", (d) => xScale(d.prob));
124122

125123
const labelFontSize = Math.min(14, Math.max(5, yScale.bandwidth() * 0.9));
126124
svg
@@ -134,8 +132,7 @@ export default function Barplot({ data, onTickClick, disabled }) {
134132
.attr("dy", "0.35em")
135133
.attr("dx", "8px")
136134
.style("font-size", `${labelFontSize}px`)
137-
.text((d) => (Number(d.prob) === 0 ? "<0.01" : d.prob))
138-
.attr("fill", "white");
135+
.text((d) => (Number(d.prob) === 0 ? "<0.01" : d.prob));
139136
}, [data, size]);
140137

141138
const hasData = data && data.length > 0;

client/src/components/ChatOutput.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function uncertaintyBg(token) {
66
const p = probs[selected_idx];
77
if (typeof p !== "number") return "transparent";
88
const u = Math.max(0, Math.min(1, 1 - Number(p.toFixed(2))));
9-
return `rgba(231, 76, 60, ${u})`;
9+
return `rgb(var(--color-danger) / ${u})`;
1010
}
1111

1212
export default function ChatOutput({

client/src/index.css

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,24 @@
44

55
/* Light mode (default) */
66
:root {
7-
--color-bg: 245 246 250;
8-
--color-panel: 225 232 237;
9-
--color-input: 213 221 227;
10-
--color-border: 127 140 141;
11-
--color-fg: 33 33 33;
7+
--color-bg: 255 255 255;
8+
--color-panel: 244 244 245;
9+
--color-input: 250 250 250;
10+
--color-border: 161 161 170;
11+
--color-fg: 24 24 27;
12+
--color-accent: 37 99 235;
13+
--color-danger: 220 38 38;
1214
}
1315

1416
/* Dark mode */
1517
.dark {
16-
--color-bg: 33 33 33;
17-
--color-panel: 32 44 51;
18-
--color-input: 42 57 66;
19-
--color-border: 127 140 141;
20-
--color-fg: 245 246 250;
18+
--color-bg: 9 9 11;
19+
--color-panel: 24 24 27;
20+
--color-input: 39 39 42;
21+
--color-border: 82 82 91;
22+
--color-fg: 250 250 250;
23+
--color-accent: 59 130 246;
24+
--color-danger: 239 68 68;
2125
}
2226

2327
html,
@@ -77,7 +81,7 @@ input[type="number"] {
7781
cursor: pointer;
7882
}
7983
.barplot-svg .bar {
80-
fill: rgb(39, 174, 96);
84+
fill: rgb(var(--color-accent));
8185
}
8286
.barplot-svg .label {
8387
fill: rgb(var(--color-fg));
@@ -99,7 +103,7 @@ input[type="number"] {
99103
}
100104
.token-selected {
101105
text-decoration: underline;
102-
text-decoration-color: rgb(39, 174, 96);
106+
text-decoration-color: rgb(var(--color-accent));
103107
text-decoration-thickness: 3px;
104108
}
105109

@@ -116,7 +120,7 @@ input[type="number"] {
116120
overflow: hidden;
117121
background-color: transparent;
118122
transition: background ease 0.3s;
119-
border: 1px solid rgb(127, 140, 141);
123+
border: 1px solid rgb(var(--color-border));
120124
flex-shrink: 0;
121125
}
122126
.toggle:before {
@@ -140,7 +144,7 @@ input[type="number"] {
140144
transition: transform cubic-bezier(0.3, 1.5, 0.7, 1) 0.2s;
141145
}
142146
.toggle:checked {
143-
background-color: rgb(39, 174, 96);
147+
background-color: rgb(var(--color-accent));
144148
}
145149
.toggle:checked:before {
146150
transform: translateX(30px);
@@ -153,7 +157,7 @@ input[type="number"] {
153157
height: 26px;
154158
background: transparent;
155159
outline: none;
156-
border: 1px solid rgb(127, 140, 141);
160+
border: 1px solid rgb(var(--color-border));
157161
}
158162
.slider::-webkit-slider-thumb {
159163
-webkit-appearance: none;

client/tailwind.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export default {
1010
input: "rgb(var(--color-input) / <alpha-value>)",
1111
border: "rgb(var(--color-border) / <alpha-value>)",
1212
fg: "rgb(var(--color-fg) / <alpha-value>)",
13-
accent: "#27ae60",
14-
danger: "#c0392b",
13+
accent: "rgb(var(--color-accent) / <alpha-value>)",
14+
danger: "rgb(var(--color-danger) / <alpha-value>)",
1515
},
1616
fontFamily: {
1717
mono: [

0 commit comments

Comments
 (0)