-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor button component to use link component and remove unus…
…ed variants
- Loading branch information
1 parent
5b8e4a7
commit c0545ea
Showing
4 changed files
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% props variant = 'default', size = 'default' %} | ||
|
||
{% set linkVariants = cva({ | ||
base: 'inline-flex items-center justify-center gap-2 w-fit whitespace-nowrap transition-colors underline-offset-4 hover:underline', | ||
variants: { | ||
variant: { | ||
default: 'text-primary', | ||
secondary: 'text-secondary', | ||
}, | ||
size: { | ||
default: 'text-base', | ||
sm: 'text-sm', | ||
lg: 'text-lg', | ||
} | ||
}, | ||
defaultVariants: { | ||
variant: 'default', | ||
size: 'default', | ||
} | ||
}) %} | ||
|
||
<a {{ attributes.without('class') }} | ||
class="{{ linkVariants.apply({variant, size}, attributes.render('class'))|tailwind_merge }}" | ||
> | ||
{% block content '' %} | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters