Skip to content

Commit 799c1a1

Browse files
committed
style(theme): improve mobile responsiveness of homepage components
1 parent 23fdad8 commit 799c1a1

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

docs/.vitepress/theme/components/HomeHeroCopy.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@
9898
position: relative;
9999
user-select: none;
100100
max-width: 100%;
101-
min-width: 300px;
101+
/* min-width: 300px; Remove fixed min-width for mobile */
102+
width: 100%;
102103
}
103104
104105
.hero-copy-btn:hover {

docs/.vitepress/theme/styles/main.css

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ details > summary:hover {
207207
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
208208
font-size: 0.82rem;
209209
letter-spacing: 0;
210+
overflow-wrap: anywhere;
211+
text-align: left;
212+
height: auto;
213+
padding: 12px 20px;
214+
line-height: 1.4;
215+
white-space: normal;
216+
max-width: calc(100vw - 2 * 24px)
210217
}
211218

212219
.VPHome .VPFeatures {
@@ -249,10 +256,16 @@ details > summary:hover {
249256
.home-benefits__grid {
250257
margin-top: 16px;
251258
display: grid;
252-
grid-template-columns: repeat(2, minmax(0, 1fr));
259+
grid-template-columns: 1fr;
253260
gap: 10px;
254261
}
255262

263+
@media (min-width: 768px) {
264+
.home-benefits__grid {
265+
grid-template-columns: repeat(2, minmax(0, 1fr));
266+
}
267+
}
268+
256269
.home-benefits__item {
257270
border: 1px solid var(--vp-c-divider);
258271
border-radius: 14px;
@@ -298,7 +311,7 @@ a.home-benefits__item:hover {
298311
.home-new-app {
299312
margin: 20px auto 30px;
300313
max-width: 1152px;
301-
padding: 40px;
314+
padding: 24px;
302315
border-radius: 20px;
303316
background:
304317
radial-gradient(1200px 550px at 12% 4%, color-mix(in srgb, var(--vp-c-brand-1) 12%, transparent) 0%, transparent 68%),
@@ -404,11 +417,29 @@ a.home-benefits__item:hover {
404417

405418
@media (max-width: 768px) {
406419
.VPHome .VPHero {
407-
padding-top: 64px;
420+
padding-top: 32px;
421+
padding-bottom: 24px;
422+
}
423+
424+
.VPHome .VPHero .image-src {
425+
max-height: 192px;
426+
}
427+
428+
.VPHome .VPHero .main {
429+
margin-top: -24px;
430+
}
431+
432+
.VPHome .VPHero .tagline {
433+
margin-bottom: 12px;
434+
}
435+
436+
.VPHome .VPHero .actions {
437+
margin-top: 8px;
408438
}
409439

410440
.VPHome .VPHero .actions .action:nth-child(1) .VPButton {
411441
font-size: 0.74rem;
442+
padding: 8px 12px;
412443
}
413444
}
414445

0 commit comments

Comments
 (0)