Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore original tighter line-height on <LinkCard> titles #1386

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/eighty-cats-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@astrojs/starlight': minor
---

Tightens `line-height` on `<LinkCard>` titles to fix regression from original design

If you want to preserve the previous `line-height`, you can add the following custom CSS to your site:

```css
.sl-link-card a {
line-height: 1.6;
}
```
10 changes: 5 additions & 5 deletions packages/starlight/user-components/LinkCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface Props extends Omit<HTMLAttributes<'a'>, 'title'> {
const { title, description, ...attributes } = Astro.props;
---

<div>
<div class="sl-link-card">
<span class="sl-flex stack">
<a {...attributes}>
<span class="title" set:html={title} />
Expand All @@ -21,7 +21,7 @@ const { title, description, ...attributes } = Astro.props;
</div>

<style>
div {
.sl-link-card {
display: grid;
grid-template-columns: 1fr auto;
gap: 0.5rem;
Expand All @@ -34,6 +34,7 @@ const { title, description, ...attributes } = Astro.props;

a {
text-decoration: none;
line-height: var(--sl-line-height-headings);
}

/* a11y fix for https://github.com/withastro/starlight/issues/487 */
Expand All @@ -52,7 +53,6 @@ const { title, description, ...attributes } = Astro.props;
color: var(--sl-color-white);
font-weight: 600;
font-size: var(--sl-text-lg);
line-height: var(--sl-line-height-headings);
}

.description {
Expand All @@ -65,12 +65,12 @@ const { title, description, ...attributes } = Astro.props;
}

/* Hover state */
div:hover {
.sl-link-card:hover {
background: var(--sl-color-gray-7, var(--sl-color-gray-6));
border-color: var(--sl-color-gray-2);
}

div:hover .icon {
.sl-link-card:hover .icon {
color: var(--sl-color-white);
}
</style>
Loading