Skip to content

Commit 0e287df

Browse files
committed
feat: Improve docs-site mobile responsiveness
Fix code block overflow issues and enhance mobile experience: CodeBlock improvements: - Add max-width: 100% to prevent overflow - Extend code blocks to screen edges on mobile - Reduce font sizes on small screens (0.8125rem -> 0.75rem) - Adjust line numbers spacing for mobile - Ensure proper horizontal scrolling when needed Alert component: - Reduce padding and font sizes on mobile - Adjust icon sizes for smaller screens Global improvements: - Prevent horizontal scrolling (overflow-x: hidden) - Make images and tables responsive - Better text wrapping (word-wrap, overflow-wrap) - Responsive font sizes for headings (480px - 768px) Home page: - Stack hero buttons vertically on mobile - Reduce hero stats font sizes - Adjust padding and spacing for small screens - Responsive feature cards and icons
1 parent d64610a commit 0e287df

4 files changed

Lines changed: 196 additions & 0 deletions

File tree

docs-site/src/components/Alert/Alert.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,24 @@
7171
.alert-error .alert-icon {
7272
color: var(--error);
7373
}
74+
75+
/* Mobile responsiveness */
76+
@media (max-width: 640px) {
77+
.alert {
78+
padding: 0.875rem 1rem;
79+
margin: 1rem 0;
80+
gap: 0.75rem;
81+
}
82+
83+
.alert-icon {
84+
font-size: 1.25rem;
85+
}
86+
87+
.alert-message {
88+
font-size: 0.875rem;
89+
}
90+
91+
.alert-title {
92+
font-size: 0.9375rem;
93+
}
94+
}

docs-site/src/components/CodeBlock/CodeBlock.css

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
border-radius: 8px;
44
overflow: hidden;
55
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
6+
max-width: 100%;
67
}
78

89
.code-block-title {
@@ -21,6 +22,15 @@
2122
overflow-x: auto;
2223
font-size: 0.875rem;
2324
line-height: 1.7;
25+
max-width: 100%;
26+
}
27+
28+
/* Ensure code doesn't overflow */
29+
.code-block pre code {
30+
display: block;
31+
white-space: pre;
32+
word-wrap: normal;
33+
overflow-wrap: normal;
2434
}
2535

2636
.code-block code {
@@ -83,3 +93,50 @@
8393
.code-block pre::-webkit-scrollbar-thumb:hover {
8494
background: #475569;
8595
}
96+
97+
/* Mobile responsiveness */
98+
@media (max-width: 640px) {
99+
.code-block {
100+
margin: 1rem -1rem; /* Extend to edges on mobile */
101+
border-radius: 0;
102+
}
103+
104+
.code-block pre {
105+
padding: 1rem;
106+
font-size: 0.8125rem; /* Slightly smaller on mobile */
107+
}
108+
109+
.code-block code {
110+
font-size: 0.8125rem;
111+
}
112+
113+
.code-block-title {
114+
padding: 0.625rem 1rem;
115+
font-size: 0.8125rem;
116+
}
117+
118+
/* Adjust line numbers on mobile */
119+
.code-block pre.line-numbers {
120+
padding-left: 3rem;
121+
}
122+
123+
.code-block pre.line-numbers .line-numbers-rows {
124+
left: -3rem;
125+
width: 2.5rem;
126+
}
127+
128+
.code-block pre.line-numbers .line-numbers-rows > span:before {
129+
padding-right: 0.5rem;
130+
}
131+
}
132+
133+
@media (max-width: 480px) {
134+
.code-block pre {
135+
padding: 0.875rem;
136+
font-size: 0.75rem;
137+
}
138+
139+
.code-block code {
140+
font-size: 0.75rem;
141+
}
142+
}

docs-site/src/index.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@ li {
104104
background: var(--text-secondary);
105105
}
106106

107+
/* Prevent horizontal scrolling */
108+
html, body {
109+
overflow-x: hidden;
110+
max-width: 100vw;
111+
}
112+
113+
/* Ensure images and tables are responsive */
114+
img {
115+
max-width: 100%;
116+
height: auto;
117+
}
118+
119+
table {
120+
display: block;
121+
overflow-x: auto;
122+
white-space: nowrap;
123+
max-width: 100%;
124+
}
125+
107126
/* Responsive */
108127
@media (max-width: 768px) {
109128
h1 {
@@ -117,4 +136,33 @@ li {
117136
h3 {
118137
font-size: 1.25rem;
119138
}
139+
140+
/* Better text wrapping on mobile */
141+
p, li {
142+
word-wrap: break-word;
143+
overflow-wrap: break-word;
144+
}
145+
146+
/* Adjust padding for mobile */
147+
ul, ol {
148+
padding-left: 1.5rem;
149+
}
150+
}
151+
152+
@media (max-width: 480px) {
153+
h1 {
154+
font-size: 1.75rem;
155+
}
156+
157+
h2 {
158+
font-size: 1.375rem;
159+
}
160+
161+
h3 {
162+
font-size: 1.125rem;
163+
}
164+
165+
body {
166+
font-size: 0.9375rem;
167+
}
120168
}

docs-site/src/pages/Home.css

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,18 @@
283283
align-items: stretch;
284284
}
285285

286+
.btn {
287+
justify-content: center;
288+
}
289+
290+
.hero-stats {
291+
gap: 2rem;
292+
}
293+
294+
.stat-value {
295+
font-size: 2rem;
296+
}
297+
286298
.step {
287299
flex-direction: column;
288300
}
@@ -291,4 +303,62 @@
291303
.next-steps-grid {
292304
grid-template-columns: 1fr;
293305
}
306+
307+
.feature-card,
308+
.next-step-card {
309+
padding: 1.5rem;
310+
}
311+
}
312+
313+
@media (max-width: 640px) {
314+
.hero {
315+
padding: 2rem 0 3rem;
316+
}
317+
318+
.hero-title {
319+
font-size: 1.75rem;
320+
}
321+
322+
.hero-description {
323+
font-size: 1rem;
324+
}
325+
326+
.hero-badge {
327+
font-size: 0.8125rem;
328+
padding: 0.375rem 1rem;
329+
}
330+
331+
.btn {
332+
padding: 0.75rem 1.5rem;
333+
font-size: 0.9375rem;
334+
}
335+
336+
.hero-stats {
337+
gap: 1.5rem;
338+
}
339+
340+
.stat-value {
341+
font-size: 1.75rem;
342+
}
343+
344+
.stat-label {
345+
font-size: 0.8125rem;
346+
}
347+
348+
.section {
349+
margin: 2.5rem 0;
350+
}
351+
352+
.feature-card,
353+
.next-step-card {
354+
padding: 1.25rem;
355+
}
356+
357+
.feature-icon {
358+
font-size: 2rem;
359+
}
360+
361+
.next-step-icon {
362+
font-size: 1.75rem;
363+
}
294364
}

0 commit comments

Comments
 (0)