-
-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Lorenzo Lewis <[email protected]> Co-authored-by: Chris Swithinbank <[email protected]>
- Loading branch information
1 parent
bf91e27
commit 73eb5e6
Showing
5 changed files
with
121 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@astrojs/starlight": minor | ||
--- | ||
|
||
Add `LinkCard` component |
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,65 @@ | ||
--- | ||
import Icon from './Icon.astro'; | ||
import type { HTMLAttributes } from 'astro/types'; | ||
interface Props extends Omit<HTMLAttributes<'a'>, 'title'> { | ||
title: string; | ||
description?: string; | ||
} | ||
const { title, description, ...attributes } = Astro.props; | ||
--- | ||
|
||
<div> | ||
<a {...attributes}> | ||
<span class="flex stack"> | ||
<span class="title" set:html={title} /> | ||
{description && <span class="description" set:html={description} />} | ||
</span> | ||
<Icon name="right-arrow" size="1.333em" class="icon rtl:flip" /> | ||
</a> | ||
</div> | ||
|
||
<style> | ||
a { | ||
display: grid; | ||
grid-template-columns: 1fr auto; | ||
gap: 0.5rem; | ||
border: 1px solid var(--sl-color-gray-5); | ||
border-radius: 0.5rem; | ||
padding: 1rem; | ||
text-decoration: none; | ||
box-shadow: var(--sl-shadow-sm); | ||
} | ||
|
||
.stack { | ||
flex-direction: column; | ||
gap: 0.5rem; | ||
} | ||
|
||
.title { | ||
color: var(--sl-color-white); | ||
font-weight: 600; | ||
font-size: var(--sl-text-lg); | ||
line-height: var(--sl-line-height-headings); | ||
} | ||
|
||
.description { | ||
color: var(--sl-color-gray-3); | ||
line-height: 1.5; | ||
} | ||
|
||
.icon { | ||
color: var(--sl-color-gray-3); | ||
} | ||
|
||
/* Hover state */ | ||
a:hover { | ||
background: var(--sl-color-gray-7, var(--sl-color-gray-6)); | ||
border-color: var(--sl-color-gray-2); | ||
} | ||
|
||
a:hover .icon { | ||
color: var(--sl-color-white); | ||
} | ||
</style> |