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

fix: prevent list items from overflowing Markdown content #1736

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion docs/src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pnpm create astro --template starlight
```

</TabItem>
<TabItem label="Yarn">
<TabItem label="Yarnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn">

```sh
yarn create astro --template starlight
Expand Down
14 changes: 14 additions & 0 deletions docs/src/content/docs/guides/authoring-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,3 +368,17 @@ Starlight supports all other Markdown authoring syntax, such as lists and tables
## Advanced Markdown and MDX configuration

Starlight uses Astro’s Markdown and MDX renderer built on remark and rehype. You can add support for custom syntax and behavior by adding `remarkPlugins` or `rehypePlugins` in your Astro config file. See [“Configuring Markdown and MDX”](https://docs.astro.build/en/guides/markdown-content/#configuring-markdown-and-mdx) in the Astro docs to learn more.

## Test

I'm a test in a sentence https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com.

Then, let's check some unordered lists:
- https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com
- https://github.com/withastro/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- https://github.com/withastro/starlight

Then, let's check some ordered lists:
1. https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com
1. https://github.com/withastro/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1. https://github.com/withastro/starlight
2 changes: 1 addition & 1 deletion docs/src/content/docs/guides/customization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ It provides npm modules you can install for the fonts you want to use and includ

</TabItem>

<TabItem label="Yarn">
<TabItem label="Yarnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn">

```sh
yarn add @fontsource/ibm-plex-serif
Expand Down
5 changes: 5 additions & 0 deletions packages/starlight/style/markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
margin-top: 0.25rem;
}

.sl-markdown-content li:not(:where(.not-content *)) {
background: rgba(255, 0, 0, .5);
overflow-wrap: anywhere;
}

.sl-markdown-content
li
> :last-child:not(li, ul, ol):not(a, strong, em, del, span, input, :where(.not-content *)) {
Expand Down
1 change: 1 addition & 0 deletions packages/starlight/user-components/Tabs.astro
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const { html, panels } = processPanels(panelHtml);
border-bottom: 2px solid var(--sl-color-gray-5);
color: var(--sl-color-gray-3);
outline-offset: var(--sl-outline-offset-inside);
overflow-wrap: initial;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that this makes sense given how overflow-wrap is inherited 👍

}
.tab [role='tab'][aria-selected='true'] {
color: var(--sl-color-white);
Expand Down
Loading