Skip to content

Commit 9f4503d

Browse files
turtleclaude
andcommitted
fix: prevent details/code content from overflowing on mobile
- Add overflow-x: auto and word-wrap to details content - Make code/pre blocks wrap instead of forcing horizontal scroll - Add overflow-wrap to .better_r text containers Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5b356ea commit 9f4503d

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/sass/base/_basic.sass

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ section
7575
line-height: 1.5
7676
text-align: justify
7777
text-rendering: optimizelegibility
78+
overflow-wrap: break-word
79+
word-wrap: break-word
7880

7981
@media print
8082
header, footer, .lt_particles, .skip-link, #gt-link, .snackbar, .alert-container

src/sass/components/_details.sass

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ details
1919
background-color: var(--bg-details)
2020
& > div
2121
padding: .5rem
22+
overflow-x: auto
23+
word-wrap: break-word
2224
details[open]
2325
summary
2426
background-color: var(--bg-details-open)

src/sass/elements/_code.sass

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ pre
88
border-radius: var(--radius)!important
99
border-left: var(--radius) solid var(--primary)
1010
background-color: var(--bg)
11+
overflow-x: auto
12+
max-width: 100%
1113
& > code
1214
margin: 0
1315
padding: 1.5rem 1.0rem
@@ -17,7 +19,8 @@ kbd,
1719
samp
1820
padding: .1rem .3rem
1921
background: var(--bg2)
20-
white-space: pre
22+
white-space: pre-wrap
23+
word-break: break-word
2124
font-size: 90%
2225
border-radius: 6px
2326
kbd

0 commit comments

Comments
 (0)