Skip to content

Commit

Permalink
fix button hover effect
Browse files Browse the repository at this point in the history
  • Loading branch information
waalbert committed Nov 24, 2024
1 parent 2bfe3b7 commit a163f9a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
9 changes: 7 additions & 2 deletions apps/site/src/lib/components/Button/Button.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
display: block;
width: max-content;
margin: 0 auto;
}

.buttonBox {
display: inline-block;
background-color: white;

&:hover {
box-shadow: 8px 8px 0px var(--color-white);
&:hover > .button {
transform: translate(-8px, -8px);
filter: brightness(1.05);
}
}
Expand Down
44 changes: 24 additions & 20 deletions apps/site/src/lib/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,33 @@ const Button: React.FC<ButtonProps> = ({
}) => {
if (href) {
return (
<Link
href={href}
className={clsx(
styles.button,
isLightVersion && styles.lightButton,
isLightVersion ? "font-display" : "font-body",
className,
)}
prefetch={usePrefetch}
>
{text}
</Link>
<div className={styles.buttonBox}>
<Link
href={href}
className={clsx(
styles.button,
isLightVersion && styles.lightButton,
isLightVersion ? "font-display" : "font-body",
className,
)}
prefetch={usePrefetch}
>
{text}
</Link>
</div>
);
}
return (
<button
type="submit"
className={styles.button + " font-display"}
disabled={disabled}
style={style ? style : { width: "max-content" }}
>
{text}
</button>
<div className={styles.buttonBox}>
<button
type="submit"
className={styles.button + " font-display"}
disabled={disabled}
style={style ? style : { width: "max-content" }}
>
{text}
</button>
</div>
);
};

Expand Down

0 comments on commit a163f9a

Please sign in to comment.