fix: adjust padding for tab indicator

This commit is contained in:
codytseng 2025-08-25 10:57:45 +08:00
parent a33a54b1de
commit 68d0c85dd2
2 changed files with 2 additions and 3 deletions

View file

@ -32,7 +32,7 @@ export default function Tabs({
if (activeIndex >= 0 && tabRefs.current[activeIndex]) {
const activeTab = tabRefs.current[activeIndex]
const { offsetWidth, offsetLeft } = activeTab
const padding = 48 // 24px padding on each side
const padding = 24 // 12px padding on each side
setIndicatorStyle({
width: offsetWidth - padding,
left: offsetLeft + padding / 2
@ -67,7 +67,7 @@ export default function Tabs({
return (
<div
className={cn(
'sticky flex justify-between top-12 bg-background z-30 w-full transition-transform',
'sticky flex justify-between top-12 bg-background z-30 px-1 w-full transition-transform',
deepBrowsing && lastScrollTop > threshold ? '-translate-y-[calc(100%+12rem)]' : ''
)}
>