From 50b39cfd08a4305ab4e0423c2fef1fe3d0771087 Mon Sep 17 00:00:00 2001 From: Shibo Lyu Date: Tue, 3 Sep 2024 22:28:56 +0800 Subject: [PATCH] fix: primary button dark appearance --- src/lib/components/Button.svelte | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib/components/Button.svelte b/src/lib/components/Button.svelte index 76d8ced..19d8a92 100644 --- a/src/lib/components/Button.svelte +++ b/src/lib/components/Button.svelte @@ -19,9 +19,14 @@ this={href ? 'a' : 'button'} {href} class={tw( - 'inline-flex cursor-default items-center justify-center rounded-md px-2 py-1 text-sf-secondary shadow-sm ring-1 ring-ss-secondary transition-shadow duration-200 hover:ring-ss-primary active:shadow-inner', - variant === 'primary' && - 'relative text-slate-50 ring-0 duration-200 before:absolute before:-inset-px before:rounded-[7px] before:bg-gradient-to-b before:from-accent-400 before:from-40% before:to-accent-500 before:ring-1 before:ring-inset before:ring-black/10 before:transition-shadow active:before:shadow-inner', + 'inline-flex cursor-default items-center justify-center rounded-md px-2 py-1 text-sf-secondary shadow-sm ring-1 ring-ss-secondary', + 'transition-shadow duration-200 hover:ring-ss-primary active:shadow-inner', + variant === 'primary' && [ + 'relative text-slate-50 ring-0 duration-200', + 'before:absolute before:-inset-px before:rounded-[7px]', + 'before:bg-gradient-to-b before:from-accent-400 before:from-40% before:to-accent-500 before:ring-1 before:ring-inset before:ring-black/10', + 'before:transition-shadow active:before:shadow-inner dark:before:from-accent-500 dark:before:to-accent-600' + ], className )} {...$$restProps}