diff --git a/src/lib/components/ui/button/button.svelte b/src/lib/components/ui/button/button.svelte index a7bd70b..e009250 100644 --- a/src/lib/components/ui/button/button.svelte +++ b/src/lib/components/ui/button/button.svelte @@ -6,7 +6,7 @@ import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements'; export const buttonVariants = tv({ - base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", + base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", variants: { variant: { default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs', diff --git a/src/routes/weather/week/[location]/DailyCards.svelte b/src/routes/weather/week/[location]/DailyCards.svelte index ada330f..2aab042 100644 --- a/src/routes/weather/week/[location]/DailyCards.svelte +++ b/src/routes/weather/week/[location]/DailyCards.svelte @@ -57,8 +57,10 @@ // defer to after layout so the measured positions and scroll width are final requestAnimationFrame(() => { // scroll so the first day card sits exactly at the content edge (aligned - // with the page hero), leaving the "past days" button fully off to the left - el.scrollLeft += wrap.getBoundingClientRect().left - el.getBoundingClientRect().left; + // with the page hero), leaving the "past days" button fully off to the + // left. The scroll's pl-3 keeps the lifted/scaled card from being clipped, + // so subtract it here to land the card on the content edge. + el.scrollLeft += wrap.getBoundingClientRect().left - el.getBoundingClientRect().left - 12; }); }); @@ -129,7 +131,7 @@ clipped, while the first card still lines up with the page content edge. -->