Skip to content

Commit

Permalink
fix: prevent text from overflowing prev/next links (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-deramond committed Oct 24, 2023
1 parent faf096c commit 1e517d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tasty-garlics-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Prevent text from overflowing pagination items
10 changes: 8 additions & 2 deletions packages/starlight/components/Pagination.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const isRtl = dir === 'rtl';
const t = useTranslations(locale);
---

<div class="pagination-links sl-flex" dir={dir}>
<div class="pagination-links" dir={dir}>
{
prev && (
<a href={prev.href} rel="prev">
Expand Down Expand Up @@ -38,7 +38,8 @@ const t = useTranslations(locale);

<style>
.pagination-links {
flex-wrap: wrap;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
gap: 1rem;
}

Expand All @@ -56,6 +57,7 @@ const t = useTranslations(locale);
text-decoration: none;
color: var(--sl-color-gray-2);
box-shadow: var(--sl-shadow-md);
overflow-wrap: anywhere;
}
[rel='next'] {
justify-content: end;
Expand All @@ -71,4 +73,8 @@ const t = useTranslations(locale);
font-size: var(--sl-text-2xl);
line-height: var(--sl-line-height-headings);
}

svg {
flex-shrink: 0;
}
</style>

0 comments on commit 1e517d9

Please sign in to comment.