fix: Fix colors not changing correctly

This commit is contained in:
Xyphyn committed 2023-07-25 19:19:18 -07:00
1 parent 9a6a8f5cd5
commit 516d908cf7
2 files changed
+16 -11

No files matched your search

+14 -10
View File
@@ -56,21 +56,19 @@
const dispatch = createEventDispatcher()
export let href: string | undefined = undefined
let buttonClass = twMerge(
buttonColor[color],
buttonSize[size],
buttonRoundness[rounded],
'text-sm transition-all disabled:!opacity-70 disabled:!pointer-events-none',
$$props.class
)
</script>
{#if href}
<a
{href}
{...$$restProps}
class="{buttonClass} {loading
class="{`
${buttonColor[color]}
${buttonSize[size]}
${buttonRoundness[rounded]}
text-sm transition-all disabled:!opacity-70 disabled:!pointer-events-none
${$$props.class}
`} {loading
? color == 'primary'
? '!bg-transparent !text-inherit'
: ''
@@ -94,7 +92,13 @@
disabled={loading}
{...$$restProps}
on:click={(e) => dispatch('click', e)}
class="{buttonClass} {loading
class="{`
${buttonColor[color]}
${buttonSize[size]}
${buttonRoundness[rounded]}
text-sm transition-all disabled:!opacity-70 disabled:!pointer-events-none
${$$props.class}
`} {loading
? color == 'primary'
? '!bg-transparent !text-inherit'
: ''