frameless button, link: add inverted colour state

This commit is contained in:
Elijah Duffy
2025-12-15 15:23:24 -08:00
parent a321cbffe9
commit 098bf75bd3
2 changed files with 12 additions and 2 deletions

View File

@@ -7,6 +7,7 @@
icon?: IconDef;
iconPosition?: 'left' | 'right';
disabled?: boolean;
inverted?: boolean;
class?: ClassValue | null | undefined;
children: Snippet;
onclick?: MouseEventHandler<HTMLButtonElement>;
@@ -16,6 +17,7 @@
icon,
iconPosition = 'right',
disabled = false,
inverted = false,
class: classValue,
children,
onclick
@@ -31,8 +33,11 @@
<button
type="button"
class={[
'text-sui-accent hover:text-sui-primary inline-flex cursor-pointer items-center gap-1.5 transition-colors',
'inline-flex cursor-pointer items-center gap-1.5 transition-colors',
disabled && 'pointer-events-none cursor-not-allowed opacity-50',
inverted
? 'text-sui-background hover:text-sui-background/80 font-medium'
: 'text-sui-accent hover:text-sui-primary',
classValue
]}
{onclick}

View File

@@ -40,6 +40,7 @@
basepath?: string | null;
disabled?: boolean;
tab?: 'current' | 'new';
inverted?: boolean;
class?: ClassValue | null | undefined;
children: Snippet;
onclick?: MouseEventHandler<HTMLAnchorElement>;
@@ -50,6 +51,7 @@
basepath,
disabled = false,
tab = 'current',
inverted = false,
class: classValue,
children,
onclick
@@ -60,8 +62,11 @@
<a
class={[
'text-sui-accent hover:text-sui-primary inline-flex items-center gap-1.5 transition-colors',
'inline-flex items-center gap-1.5 transition-colors',
disabled && 'pointer-events-none cursor-not-allowed opacity-50',
inverted
? 'text-sui-background hover:text-sui-background/80 font-medium'
: 'text-sui-accent hover:text-sui-primary',
classValue
]}
href={computedHref}