diff --git a/src/components/Button.astro b/src/components/Button.astro index c41fbb167e..cb9efe3a3e 100644 --- a/src/components/Button.astro +++ b/src/components/Button.astro @@ -2,7 +2,7 @@ import { Icon } from 'astro-icon/components'; export interface Props { - colorScheme: + colorScheme?: | 'whiteAlpha' | 'blackAlpha' | 'gray' @@ -24,7 +24,7 @@ export interface Props { style?: string; href?: string; icon?: string; - variant?: 'ghost' | 'solid'; + variant?: 'ghost' | 'solid' | 'primary' | 'secondary'; target?: string; } const { @@ -35,9 +35,17 @@ const { variant = 'solid', target = '_blank', } = Astro.props as Props; + +const isPrimary = variant === 'primary'; +const isSecondary = variant === 'secondary'; +const classes = [ + 'button', + isPrimary ? 'button-primary' : isSecondary ? 'button-secondary' : `button-${colorScheme}`, + isPrimary || isSecondary ? '' : variant, +].filter(Boolean); --- -
- Mergify eliminates broken builds, tames flaky tests, and cuts CI waste—so - your team ships with confidence. -
+