Skip to content

Commit

Permalink
Fix overflow of long site titles on narrow viewports (#1462)
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis authored Feb 6, 2024
1 parent 2e17880 commit 4741ccc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-fishes-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Fixes overflow of very long site titles on narrow viewports
7 changes: 6 additions & 1 deletion packages/starlight/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const shouldRenderSearch =
---

<div class="header sl-flex">
<div class="sl-flex">
<div class="title-wrapper sl-flex">
<SiteTitle {...Astro.props} />
</div>
<div class="sl-flex">
Expand All @@ -39,6 +39,11 @@ const shouldRenderSearch =
height: 100%;
}

.title-wrapper {
/* Prevent long titles overflowing and covering the search and menu buttons on narrow viewports. */
overflow: hidden;
}

.right-group,
.social-icons {
gap: 1rem;
Expand Down
3 changes: 0 additions & 3 deletions packages/starlight/components/SiteTitle.astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ const href = formatPath(Astro.props.locale || '/');

<style>
.site-title {
justify-self: flex-start;
max-width: 100%;
overflow: hidden;
align-items: center;
gap: var(--sl-nav-gap);
font-size: var(--sl-text-h4);
Expand Down

0 comments on commit 4741ccc

Please sign in to comment.