Skip to content

Commit 4097384

Browse files
raifdmuellerclaude
andcommitted
fix: tooltip accent line and theme-independent colors
- Use clipPath to clip accent bar to main rect's rounded corners, preventing stroke from showing through at corners - Use fixed dark colors for tooltip (always dark, like OS tooltips) instead of CSS variables that break in light mode Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 50e2805 commit 4097384

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/components/RadarChart.jsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,38 +401,41 @@ export default function RadarChart({
401401
<feDropShadow dx="0" dy="2" stdDeviation="4" floodColor="#000" floodOpacity="0.4" />
402402
</filter>
403403
</defs>
404+
<clipPath id="tt-clip">
405+
<rect x={tipX} y={tipY} width={tooltipW} height={tooltipH} rx={10} />
406+
</clipPath>
404407
<rect
405408
x={tipX}
406409
y={tipY}
407410
width={tooltipW}
408411
height={tooltipH}
409412
rx={10}
410-
fill="var(--bg-card)"
413+
fill="#1e293b"
411414
stroke={tc}
412415
strokeWidth={1.5}
413416
filter="url(#tt-shadow)"
414417
/>
415-
<rect x={tipX} y={tipY} width={4} height={tooltipH} rx={4} fill={tc} />
416-
<text x={tipX + 14} y={tipY + 19} fill="var(--text-secondary)" fontSize="11" fontWeight="500">
418+
<rect x={tipX} y={tipY} width={5} height={tooltipH} fill={tc} clipPath="url(#tt-clip)" />
419+
<text x={tipX + 14} y={tipY + 19} fill="#94a3b8" fontSize="11" fontWeight="500">
417420
{tooltip.label}
418421
</text>
419422
<text x={tipX + 14} y={tipY + 39} fill={tc} fontSize="19" fontWeight="800">
420423
{tooltip.value}
421-
<tspan fill="var(--text-muted)" fontSize="11" fontWeight="400">
424+
<tspan fill="#475569" fontSize="11" fontWeight="400">
422425
{" "}
423426
/ 4
424427
</tspan>
425428
</text>
426429
<polygon
427430
points={`${tipX + tooltipW / 2 - 7},${tipY + tooltipH} ${tipX + tooltipW / 2 + 7},${tipY + tooltipH} ${tipX + tooltipW / 2},${tipY + tooltipH + 10}`}
428-
fill="var(--bg-card)"
431+
fill="#1e293b"
429432
stroke={tc}
430433
strokeWidth={1.5}
431434
strokeLinejoin="round"
432435
/>
433436
<polygon
434437
points={`${tipX + tooltipW / 2 - 5},${tipY + tooltipH - 1} ${tipX + tooltipW / 2 + 5},${tipY + tooltipH - 1} ${tipX + tooltipW / 2},${tipY + tooltipH + 8}`}
435-
fill="var(--bg-card)"
438+
fill="#1e293b"
436439
/>
437440
</g>
438441
)}

0 commit comments

Comments
 (0)