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

css: move overflow wrap rule to markdown.css #1885

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion docs/src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Getting Started
title: Getting Started xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxx
description: Learn how to start building your next documentation site with Starlight by Astro.
---

Expand Down
12 changes: 12 additions & 0 deletions packages/starlight/style/markdown.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
.sl-markdown-content p,
.sl-markdown-content h1,
.sl-markdown-content h2,
.sl-markdown-content h3,
.sl-markdown-content h4,
.sl-markdown-content h5,
.sl-markdown-content h6,
.sl-markdown-content code {
background-color: rgba(0, 255, 0, 0.2);
overflow-wrap: anywhere;
}

.sl-markdown-content
:not(a, strong, em, del, span, input, code)
+ :not(a, strong, em, del, span, input, code, :where(.not-content *)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/style/reset.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ h4,
h5,
h6,
code {
overflow-wrap: anywhere;
background-color: rgba(255, 0, 0, 0.2);
Copy link
Contributor Author

@julien-deramond julien-deramond May 17, 2024

Choose a reason for hiding this comment

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

I've been through the entire doc, the only elements that are displayed in red (old rule) are the page main titles, and the "On this page" area (see https://starlight-git-fork-julien-deramond-main-jd-dc421d-astrodotbuild.vercel.app/getting-started/).

Screenshot 2024-05-17 at 09 26 05

The search message error is probably not important, and the main title as well:

Screenshot 2024-05-17 at 09 30 28

Screenshot 2024-05-17 at 09 31 16

The rest in green works well.

One solution would probably be to keep that in markdown.css and add specific rules for this main title and "On this page" area. What do you think @delucis? Want me to try this approach in this PR?

}

code {
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"languageSelect.accessibleLabel": "Select language",
"menuButton.accessibleLabel": "Menu",
"sidebarNav.accessibleLabel": "Main",
"tableOfContents.onThisPage": "On this page",
"tableOfContents.onThisPage": "On this page xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxx",
"tableOfContents.overview": "Overview",
"i18n.untranslatedContent": "This content is not available in your language yet.",
"page.editLink": "Edit page",
Expand Down
Loading