Skip to content

Commit e2d8c64

Browse files
committed
style: fix code block responsiveness and container widths
1 parent 9ccf660 commit e2d8c64

File tree

1 file changed

+56
-8
lines changed

1 file changed

+56
-8
lines changed

assets/css/style.css

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
33
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
44

5+
*, *::before, *::after {
6+
box-sizing: border-box;
7+
}
8+
59
:root {
610
--font-primary: 'Inter', sans-serif;
711
--font-heading: 'Outfit', sans-serif;
@@ -83,6 +87,12 @@ body {
8387
overflow-x: hidden;
8488
}
8589

90+
/* Ensure images don't overflow */
91+
img, video {
92+
max-width: 100%;
93+
height: auto;
94+
}
95+
8696
/* Sidebar */
8797
.sidebar {
8898
width: var(--sidebar-width);
@@ -279,6 +289,7 @@ body {
279289
gap: 2rem;
280290
max-width: 1400px;
281291
/* Limit max width */
292+
min-width: 0;
282293
}
283294

284295
/* Cards */
@@ -290,6 +301,8 @@ body {
290301
padding: 2rem;
291302
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
292303
margin-bottom: 2rem;
304+
min-width: 0;
305+
width: 100%;
293306
}
294307

295308
.card h3 {
@@ -310,8 +323,15 @@ body {
310323
font-family: 'Fira Code', monospace;
311324
font-size: 0.9rem;
312325
overflow-x: auto;
326+
-webkit-overflow-scrolling: touch;
313327
position: relative;
314328
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
329+
width: 100%;
330+
}
331+
332+
.code-block pre {
333+
margin: 0;
334+
white-space: pre;
315335
}
316336

317337
.code-header {
@@ -552,19 +572,39 @@ footer {
552572

553573
.main-content {
554574
margin-left: 0;
575+
width: 100%;
555576
}
556577

557578
.content-wrapper {
558-
padding: 0 1.5rem;
579+
padding: 0 1rem;
559580
margin-top: -2rem;
581+
width: 100%;
582+
max-width: 100vw;
560583
}
561584

562585
.main-header {
563-
padding: 3rem 1.5rem 4rem;
586+
padding: 3rem 1rem 4rem;
564587
}
565588

566589
.hero h1 {
567-
font-size: 2.5rem;
590+
font-size: 2rem;
591+
margin-bottom: 1rem;
592+
}
593+
594+
.card {
595+
padding: 1.5rem;
596+
}
597+
598+
/* Stack buttons on mobile for better touch targets */
599+
.hero-actions {
600+
flex-direction: column;
601+
align-items: stretch;
602+
gap: 1rem;
603+
}
604+
605+
.hero-actions .btn {
606+
width: 100%;
607+
justify-content: center;
568608
}
569609
}
570610

@@ -681,8 +721,10 @@ footer {
681721
padding: 1.25rem;
682722
border-radius: 0.5rem;
683723
overflow-x: auto;
724+
-webkit-overflow-scrolling: touch;
684725
margin-bottom: 1.5rem;
685726
color: #e2e8f0;
727+
width: 100%;
686728
}
687729

688730
.markdown-body pre code {
@@ -847,10 +889,12 @@ footer {
847889
/* Or slightly different code bg */
848890
border-radius: 6px;
849891
padding: 16px;
850-
overflow: auto;
892+
overflow-x: auto;
893+
-webkit-overflow-scrolling: touch;
851894
line-height: 1.45;
852895
margin-bottom: 16px;
853896
border: 1px solid var(--border-color);
897+
width: 100%;
854898
}
855899

856900
[data-theme="dark"] .highlight {
@@ -1045,14 +1089,18 @@ footer {
10451089

10461090
@media (max-width: 768px) {
10471091
.terminal-wrapper {
1048-
padding: 0 1.5rem;
1092+
padding: 0 1rem;
1093+
/* Ensure the wrapper doesn't cause page scroll */
1094+
max-width: 100vw;
10491095
}
10501096

10511097
.terminal {
1052-
font-size: 0.8rem;
1053-
padding: 1rem;
1098+
font-size: 0.75rem; /* Smaller font for mobile */
1099+
padding: 0.75rem;
10541100
min-height: 200px;
1055-
max-height: 400px;
1101+
max-height: 60vh; /* Use viewport height unit for better fit */
1102+
/* Ensure scrollbar doesn't overlap text awkwardly */
1103+
scrollbar-width: thin;
10561104
}
10571105
}
10581106

0 commit comments

Comments
 (0)