Skip to content

Commit

Permalink
fix: merge hover-fill-to-right utility to button component style
Browse files Browse the repository at this point in the history
  • Loading branch information
EATSTEAK committed Aug 12, 2024
1 parent bf6975e commit 7a60cdf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const Button: Component<
return (
<a
{...anchorAttributes}
class="hover-fill-to-right button"
class="button"
>
{self.children}
</a>
Expand Down
20 changes: 20 additions & 0 deletions src/components/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,25 @@
@layer components {
.button {
@apply font-mono py-2 px-4 transition-colors border-2 before:bg-white bg-gradient-to-r from-gray-800 to-gray-800 text-gray-800 hover:text-white border-gray-800 dark:before:bg-gray-800 dark:from-white dark:to-white dark:text-white dark:hover:text-gray-800 dark:border-white;

position: relative;
background-size: 0% 100%;
background-repeat: no-repeat;
background-position-y: 100%;
transition: background-size 0.25s ease-out;
}

.button::before {
position: absolute;
content: "";
top: 0;
left: 0;
z-index: -10;
width: 100%;
height: 100%;
}

.button:hover {
background-size: 100% 100%;
}
}

0 comments on commit 7a60cdf

Please sign in to comment.