Skip to content

Commit 31c5d22

Browse files
HardikMathur11Hardik Mathur
andauthored
Fix docs mobile responsiveness: prevent horizontal overflow, wrap long text (#763)
Co-authored-by: Hardik Mathur <hardikmathur11@gmial.com>
1 parent a3af96c commit 31c5d22

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

docs/stylesheets/extra.css

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@
2222

2323
/* Responsive tweaks: ensure header, images, tables and code blocks behave well on small screens */
2424

25+
/* Global text wrapping to prevent long words/URLs from overflowing */
26+
.md-typeset,
27+
.md-content {
28+
overflow-wrap: anywhere;
29+
word-break: break-word;
30+
}
31+
32+
/* Headings should wrap on small screens instead of overflowing */
33+
.md-typeset h1,
34+
.md-typeset h2,
35+
.md-typeset h3,
36+
.md-typeset h4,
37+
.md-typeset h5,
38+
.md-typeset h6 {
39+
overflow-wrap: anywhere;
40+
word-break: break-word;
41+
}
42+
2543
/* Make images scale down to container */
2644
.md-typeset img,
2745
.md-content img {
@@ -43,6 +61,12 @@
4361
overflow-x: auto;
4462
}
4563

64+
/* Inline code should also wrap to avoid pushing layout */
65+
.md-typeset code:not(pre code) {
66+
white-space: break-spaces;
67+
word-break: break-word;
68+
}
69+
4670
/* General container/content spacing adjustments for smaller screens */
4771
.md-main, .md-content {
4872
padding-left: 1rem;
@@ -312,7 +336,6 @@
312336
}
313337
}
314338

315-
\
316339
.md-footer-meta__inner.md-grid {
317340
display: flex !important;
318341
flex-direction: column !important;

0 commit comments

Comments
 (0)