Skip to content

Commit bd6f456

Browse files
committed
Prevent examples from blowing outside the viewport.
Overflow wasn't being triggered in multiple cases. Force break on whitespace and overflow-wrap anywhere. This seems to work from 350px mobile to desktop sizes.
1 parent 65b3384 commit bd6f456

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

doc/_static/style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,9 @@ dd p.first { margin-block-start: 0; }
313313
/* remove solid black border when focus is around the main section
314314
due to activation of skip-link. Page jumps there, that's enough. */
315315
#main:focus-visible {outline: none;}
316+
317+
/* Prevent examples from extending outside the viewport */
318+
div.highlight > pre {
319+
overflow-wrap: anywhere;
320+
white-space: break-spaces;
321+
}

website/www/_static/style.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,16 @@ dd p.first { margin-block-start: 0; }
314314
due to activation of skip-link. Page jumps there, that's enough. */
315315
#main:focus-visible {outline: none;}
316316

317+
/* Prevent examples from extending outside the viewport */
318+
div.highlight > pre {
319+
overflow-wrap: anywhere;
320+
white-space: break-spaces;
321+
}
322+
317323
/* website only */
318324
/* assume desktop reader for local html files, also no contact
319325
page for local doc files */
320326

321-
/* make examples with long lines scrollable */
322-
div.highlight { overflow: auto;}
323-
324327
@media only screen and (max-width:960px) {
325328
/* setup for layout/page frame */
326329
body { padding-inline-start: unset; /* remove space for float menu */}

0 commit comments

Comments
 (0)