-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
485 additions
and
159 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
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,103 @@ | ||
import React from 'react' | ||
|
||
import { Link } from 'gatsby' | ||
|
||
interface ICardLinkProps { | ||
title: React.ReactNode | ||
description?: React.ReactNode | ||
to: string | ||
className?: string | ||
} | ||
|
||
const CARD_PADDING = 16 as const | ||
|
||
function CardLink({ title, description, to, className }: ICardLinkProps) { | ||
return ( | ||
<Link | ||
className={className} | ||
to={to} | ||
css={{ | ||
textDecoration: 'none !important', | ||
display: 'flex', | ||
border: '2px solid black', | ||
outline: '0px solid black', | ||
background: 'white', | ||
|
||
'&:hover, &:focus, &:active': { | ||
outlineWidth: 2, | ||
'& $arrow': { | ||
'&::after': { | ||
transform: 'translateX(3px) scaleY(0.92) scaleX(1.05) rotate(45deg)', | ||
}, | ||
}, | ||
}, | ||
}} | ||
> | ||
<article | ||
css={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
padding: CARD_PADDING, | ||
position: 'relative', | ||
flexGrow: 1, | ||
}} | ||
> | ||
<header | ||
css={{ | ||
display: 'flex', | ||
gap: 8, | ||
}} | ||
> | ||
<h3 | ||
css={[ | ||
{ | ||
flexGrow: 1, | ||
}, | ||
!description && { | ||
marginBottom: 0, | ||
}, | ||
]} | ||
> | ||
{title} | ||
</h3> | ||
</header> | ||
|
||
{description && ( | ||
<> | ||
<div | ||
aria-hidden | ||
css={{ | ||
flexGrow: 1, | ||
}} | ||
/> | ||
<p>{description}</p> | ||
</> | ||
)} | ||
</article> | ||
|
||
<div | ||
role="presentation" | ||
aria-hidden="true" | ||
css={{ | ||
display: 'inline-flex', | ||
alignItems: 'center', | ||
padding: '10px 18px', | ||
paddingRight: 20, | ||
gap: 8, | ||
transformOrigin: 'center', | ||
'&::after': { | ||
content: '""', | ||
display: 'inline-block', | ||
width: '0.75em', | ||
height: '0.75em', | ||
borderTop: '2px solid currentColor', | ||
borderRight: '2px solid currentColor', | ||
transform: 'rotate(45deg)', | ||
}, | ||
}} | ||
/> | ||
</Link> | ||
) | ||
} | ||
|
||
export default CardLink |
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
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
Oops, something went wrong.