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

Tweak word-wrap rule to prevent long words becoming scrollburglars #1888

Merged
merged 4 commits into from
Apr 23, 2024
Merged
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
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# pkgdown (development version)

* Very wide words are now automatically broken across lines and hyphenated (when possible) when they'd otherwise create a horizontal scrollbar on mobile (#1888).
* The `repo.source.url` field no longer requires a trailing slash (#2017).
* Anywhere you can use `_pkgdown.yml`, you can now use `_pkgdown.yaml` (#2244).
* pkgdown no longer overrides the default selection colours. This improves accessibility for users who have set their own colours in their browser settings (#2139, @glin).
Expand Down
6 changes: 5 additions & 1 deletion inst/BS5/assets/pkgdown.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/* control page width ====================================================== */

// Ensure contents never become unreadably wide
.row > main {
// Ensure contents never become unreadably wide
max-width: 50rem;

// And that we can break and hypenate very long words
overflow-wrap: break-word;
hyphens: auto;
}
// Put extra space between content and navbar
@include media-breakpoint-only(xl) {
Expand Down
6 changes: 6 additions & 0 deletions vignettes/test/rendering.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,9 @@ Guten tag.
#### Heading 4

##### Heading 5

## Very long words

This word should be broken across multiple lines on mobile, rather than making the page scroll horizontally:

Ccccccccccccaaaaaaaaaaaaaaatttttttttttttttttssssssssssssssss
Loading