Skip to content

Commit 97e473f

Browse files
committed
Fix: Prevent overlapping line numbers and code content
- Add proper grid layout with min-height for code lines - Ensure line-number column doesn't shrink (flex-shrink: 0) - Add word-wrap and overflow-wrap to line-content for proper text wrapping - Set width and box-sizing on pre, code, and content-body elements - Fix align-items from 'start' to 'flex-start' for better alignment - Ensure proper width constraints to prevent layout overflow
1 parent 8994082 commit 97e473f

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

docs/styles.css

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ input {
256256
margin-top: 18px;
257257
overflow: auto;
258258
flex: 1;
259+
width: 100%;
260+
min-width: 0;
261+
box-sizing: border-box;
259262
}
260263

261264
pre {
@@ -271,12 +274,17 @@ pre {
271274
tab-size: 2;
272275
overflow-x: auto;
273276
color: #2d241d;
277+
width: 100%;
278+
box-sizing: border-box;
274279
}
275280

276281
code {
277282
white-space: pre-wrap;
278283
word-wrap: break-word;
284+
overflow-wrap: break-word;
279285
font-family: "Spline Sans Mono", monospace;
286+
display: block;
287+
width: 100%;
280288
}
281289

282290
#codeContainer {
@@ -289,19 +297,30 @@ code {
289297

290298
.code-lines {
291299
display: block;
300+
width: 100%;
292301
}
293302

294303
.code-line {
295304
display: grid;
296305
grid-template-columns: 44px 1fr;
297306
gap: 14px;
298-
align-items: start;
307+
align-items: flex-start;
308+
width: 100%;
309+
min-height: 1.6em;
299310
}
300311

301312
.line-number {
302313
text-align: right;
303314
color: rgba(31, 27, 22, 0.45);
304315
user-select: none;
316+
flex-shrink: 0;
317+
white-space: nowrap;
318+
}
319+
320+
.line-content {
321+
word-wrap: break-word;
322+
overflow-wrap: break-word;
323+
white-space: pre-wrap;
305324
}
306325

307326
.image-viewer {

0 commit comments

Comments
 (0)