Skip to content

Commit 98fd09c

Browse files
authored
docs: responsiveness fix (#6229)
1 parent e81125d commit 98fd09c

File tree

2 files changed

+41
-38
lines changed

2 files changed

+41
-38
lines changed

docs/src/css/custom.css

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ main.container {
240240
background: var(--ifm-background-surface-color);
241241
padding: 3rem 0;
242242
margin: 0;
243-
/* full width */
244243
width: 100vw;
245244
position: relative;
246245
left: 50%;
@@ -253,7 +252,6 @@ main.container {
253252
background: #111111;
254253
padding: 3rem 0;
255254
margin: 0;
256-
/* full width */
257255
width: 100vw;
258256
position: relative;
259257
left: 50%;
@@ -262,13 +260,11 @@ main.container {
262260
margin-right: -50vw;
263261
}
264262

265-
/* Section background alternation for dark mode - alternating every 2 sections */
266263
[data-theme='dark'] section:nth-child(4n+1),
267264
[data-theme='dark'] section:nth-child(4n+2) {
268265
background: #111111;
269266
padding: 3rem 0;
270267
margin: 0;
271-
/* full width */
272268
width: 100vw;
273269
position: relative;
274270
left: 50%;
@@ -282,7 +278,6 @@ main.container {
282278
background: var(--ifm-background-surface-color);
283279
padding: 3rem 0;
284280
margin: 0;
285-
/* full width */
286281
width: 100vw;
287282
position: relative;
288283
left: 50%;
@@ -291,7 +286,6 @@ main.container {
291286
margin-right: -50vw;
292287
}
293288

294-
/* container width inside sections */
295289
section > div,
296290
section > h2 {
297291
margin: 0 auto;
@@ -301,13 +295,27 @@ section > h2 {
301295
}
302296

303297
section > h2 {
304-
padding-left: var(--ifm-spacing-horizontal); /* Using the same padding as div */
298+
padding-left: var(--ifm-spacing-horizontal);
305299
}
306300

307-
/* Ensure consistent container width */
308301
.container {
309302
max-width: var(--ifm-container-width);
310303
margin: 0 auto;
311304
padding: 0 var(--ifm-spacing-horizontal);
312305
width: 100%;
313306
}
307+
308+
@media (max-width: 996px) {
309+
[data-theme='dark'] section:nth-child(4n+1),
310+
[data-theme='dark'] section:nth-child(4n+2),
311+
[data-theme='dark'] section:nth-child(4n+3),
312+
[data-theme='dark'] section:nth-child(4n+4),
313+
[data-theme='dark'] section:nth-child(odd),
314+
[data-theme='dark'] section:nth-child(even) {
315+
width: 100%;
316+
left: auto;
317+
right: auto;
318+
margin-left: auto;
319+
margin-right: auto;
320+
}
321+
}

docs/src/pages/index.module.css

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -199,44 +199,28 @@
199199
text-decoration: none;
200200
}
201201

202-
@media (max-width: 996px) {
203-
section .cardGrid {
204-
grid-template-columns: 1fr;
205-
padding: 0 1rem;
206-
}
207-
208-
.heroInner {
209-
flex-direction: column;
210-
padding: 0 1rem;
211-
}
212-
213-
.heroInner > div,
214-
.logo {
215-
max-width: 100%;
216-
width: 100%;
202+
@media (max-width: 1200px) {
203+
[data-section="integration"] .cardGrid {
204+
grid-template-columns: repeat(2, 1fr);
217205
}
218206

219-
.card {
220-
width: 100%;
221-
margin: 0 auto;
207+
[data-section="ecosystem"] .cardGrid {
208+
grid-template-columns: repeat(2, 1fr);
222209
}
210+
}
223211

224-
section,
225-
.hero,
226-
.cardGrid {
227-
width: 100vw;
228-
max-width: 100%;
229-
margin: 0;
230-
overflow-x: hidden;
212+
@media (max-width: 768px) {
213+
[data-section="introduction"] .cardGrid,
214+
[data-section="integration"] .cardGrid,
215+
[data-section="configuration"] .cardGrid,
216+
[data-section="ecosystem"] .cardGrid {
217+
grid-template-columns: repeat(2, 1fr);
231218
}
232219

233-
:global(body) {
234-
overflow-x: hidden;
235-
width: 100%;
220+
[data-section="configuration"] .cardGrid > *:last-child {
221+
grid-column: 1 / 3;
236222
}
237-
}
238223

239-
@media (max-width: 768px) {
240224
.hero {
241225
padding: 2rem 0;
242226
}
@@ -246,4 +230,15 @@
246230
}
247231
}
248232

233+
@media (max-width: 996px) {
234+
.heroInner {
235+
flex-direction: column;
236+
padding: 0 1rem;
237+
}
249238

239+
.heroInner > div,
240+
.logo {
241+
max-width: 100%;
242+
width: 100%;
243+
}
244+
}

0 commit comments

Comments
 (0)