Skip to content

Commit 8a2ba2d

Browse files
committed
Improved chart legend styling for edge cases
1 parent 4b96def commit 8a2ba2d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/webapp/app/components/primitives/charts/ChartLegendCompound.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ export function ChartLegendCompound({
177177
style={{ backgroundColor: item.color }}
178178
/>
179179
)}
180-
<div className="relative flex w-full items-center justify-between gap-2">
180+
<div className="relative flex w-full items-center justify-between gap-3">
181181
<div className="flex items-center gap-1.5">
182182
{item.color && (
183183
<div
184-
className="h-3 w-1 shrink-0 rounded-[2px]"
184+
className="w-1 shrink-0 self-stretch rounded-[2px]"
185185
style={{ backgroundColor: item.color }}
186186
/>
187187
)}
@@ -190,7 +190,10 @@ export function ChartLegendCompound({
190190
</span>
191191
</div>
192192
<span
193-
className={cn("tabular-nums", isActive ? "text-text-bright" : "text-text-dimmed")}
193+
className={cn(
194+
"self-start tabular-nums",
195+
isActive ? "text-text-bright" : "text-text-dimmed"
196+
)}
194197
>
195198
<AnimatedNumber value={total} duration={0.25} />
196199
</span>

0 commit comments

Comments
 (0)