Skip to content

Commit f55a8f0

Browse files
Prevent text from overflowing in various cases (#756)
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
1 parent d5cca92 commit f55a8f0

File tree

6 files changed

+14
-3
lines changed

6 files changed

+14
-3
lines changed

‎.changeset/smart-panthers-hang.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/starlight': patch
3+
---
4+
5+
Prevent text from overflowing in several cases

‎packages/starlight/components/Badge.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const { variant = 'default', text } = Astro.props;
2222
line-height: 1;
2323
color: #fff;
2424
background-color: var(--sl-color-bg-badge);
25+
overflow-wrap: anywhere;
2526
}
2627

2728
.outline {

‎packages/starlight/components/RightSidebarPanel.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
font-size: var(--sl-text-xs);
2727
text-decoration: none;
2828
color: var(--sl-color-gray-3);
29-
word-break: break-word;
29+
overflow-wrap: anywhere;
3030
}
3131
.right-sidebar-panel :global(a:hover) {
3232
color: var(--sl-color-white);

‎packages/starlight/components/Search.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ const pagefindTranslations = {
405405

406406
#starlight__search .pagefind-ui__result-excerpt {
407407
font-size: calc(1rem * var(--pagefind-ui-scale));
408-
word-break: break-word;
408+
overflow-wrap: anywhere;
409409
}
410410

411411
#starlight__search mark {

‎packages/starlight/components/SidebarSublist.astro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ interface Props {
5353
padding: 0;
5454
}
5555

56+
li {
57+
overflow-wrap: anywhere;
58+
}
59+
5660
ul ul li {
5761
margin-inline-start: var(--sl-sidebar-item-padding-inline);
5862
border-inline-start: 1px solid var(--sl-color-hairline-light);
@@ -84,6 +88,7 @@ interface Props {
8488

8589
.caret {
8690
transition: transform 0.2s ease-in-out;
91+
flex-shrink: 0;
8792
}
8893
:global([dir='rtl']) .caret {
8994
transform: rotateZ(180deg);

‎packages/starlight/style/reset.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ h4,
4040
h5,
4141
h6,
4242
code {
43-
overflow-wrap: break-word;
43+
overflow-wrap: anywhere;
4444
}
4545

4646
code {

0 commit comments

Comments
 (0)