fix: format code and ensure consistent styling across files

This commit is contained in:
mr. M 2025-01-08 00:19:40 +01:00
parent 2a9df52722
commit d14b44b2c8
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB
43 changed files with 14294 additions and 11609 deletions

View file

@ -1,23 +1,63 @@
---
const { class: className, isPrimary, isAlert, isBordered, href, id, extra } = Astro.props;
const {
class: className,
isPrimary,
isAlert,
isBordered,
href,
id,
extra,
} = Astro.props
---
{href ? (
<a id={id} {...extra} href={href} class:list={['px-6 py-2 flex gap-2 items-center justify-center rounded-full transition-transform duration-200', className, isPrimary ? 'bg-dark text-paper' : isAlert ? 'bg-red-300 text-dark' : !isBordered ? 'hover:bg-dark border-2 border-dark hover:text-paper' : 'border-2 border-dark hover:bg-dark hover:shadow-sm hover:text-paper !transition-bg']} >
<slot />
</a>
) : (
<button id={id} {...extra} class:list={['px-6 py-2 flex gap-2 items-center justify-center rounded-full transition-transform duration-200', className, isPrimary ? 'bg-dark text-paper' : isAlert ? 'bg-red-300 text-dark' : !isBordered ? 'hover:bg-dark border-2 border-dark hover:text-paper' : 'border-2 border-dark hover:bg-dark hover:shadow-sm hover:text-paper !transition-bg']} >
<slot />
</button>
)}
{
href ? (
<a
id={id}
{...extra}
href={href}
class:list={[
'flex items-center justify-center gap-2 rounded-full px-6 py-2 transition-transform duration-200',
className,
isPrimary
? 'bg-dark text-paper'
: isAlert
? 'bg-red-300 text-dark'
: !isBordered
? 'border-2 border-dark hover:bg-dark hover:text-paper'
: '!transition-bg border-2 border-dark hover:bg-dark hover:text-paper hover:shadow-sm',
]}
>
<slot />
</a>
) : (
<button
id={id}
{...extra}
class:list={[
'flex items-center justify-center gap-2 rounded-full px-6 py-2 transition-transform duration-200',
className,
isPrimary
? 'bg-dark text-paper'
: isAlert
? 'bg-red-300 text-dark'
: !isBordered
? 'border-2 border-dark hover:bg-dark hover:text-paper'
: '!transition-bg border-2 border-dark hover:bg-dark hover:text-paper hover:shadow-sm',
]}
>
<slot />
</button>
)
}
<style>
button, a {
font-size: .9rem;
button,
a {
font-size: 0.9rem;
&[disabled] {
cursor: not-allowed;
opacity: .5;
opacity: 0.5;
}
}
</style>
</style>