Skip to content

Commit 79c7677

Browse files
authored
Merge pull request #2626 from AbhiVarde/fix-2599-mobile-form-layouts
fix: responsive form layouts, developer toolkit, and thread card overflow on mobile
2 parents a50c42d + 2a78253 commit 79c7677

File tree

4 files changed

+46
-25
lines changed

4 files changed

+46
-25
lines changed

src/routes/(marketing)/(components)/developers-toolkit.svelte

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,19 @@
5252
</p>
5353
</div>
5454

55-
<div class="mt-6 flex flex-wrap items-center justify-center gap-0">
55+
<div
56+
class="mt-6 flex flex-col items-center justify-center gap-2 lg:flex-row lg:flex-wrap lg:gap-0"
57+
>
5658
<!-- Build group -->
5759
<div
58-
class="text-primary flex h-10 items-center gap-4 rounded-full border border-dashed border-black/8 bg-white p-1 text-sm"
60+
class="text-primary flex h-10 w-full items-center gap-4 rounded-full border border-dashed border-black/8 bg-white p-1 text-sm lg:w-auto"
5961
>
6062
<span class="text-eyebrow text-secondary font-aeonik-fono ml-3 uppercase">Build</span>
6163
<div class="flex h-full w-full justify-between gap-2">
6264
{#each build as product}
6365
<a
6466
href={product.href}
65-
class="bg-smooth hover:bg-smooth/50 flex h-full w-fit items-center justify-center gap-2 rounded-full px-3 backdrop-blur-lg transition-opacity"
67+
class="bg-smooth hover:bg-smooth/50 flex h-full w-fit items-center justify-center gap-2 rounded-full px-0.5 backdrop-blur-lg transition-opacity sm:px-1 md:px-2 lg:px-3"
6668
>
6769
<span
6870
class="text-primary text-caption flex items-center justify-center gap-1 font-medium"
@@ -73,16 +75,15 @@
7375
alt={product.label}
7476
class="size-6"
7577
/>
76-
{product.label}
78+
<span class="hidden lg:inline">{product.label}</span>
7779
</span>
7880
</a>
7981
{/each}
8082
</div>
8183
</div>
82-
<!-- dashed gap between groups (horizontal) -->
8384
<div
8485
aria-hidden="true"
85-
class="mx-0 h-px w-6 self-center border-t border-dashed border-black/8"
86+
class="mx-0 hidden h-px w-6 self-center border-t border-dashed border-black/8 lg:block"
8687
></div>
8788
<!-- Deploy group -->
8889
<div
@@ -93,7 +94,7 @@
9394
{#each deploy as product}
9495
<a
9596
href={product.href}
96-
class="bg-smooth hover:bg-smooth/50 flex h-full w-fit items-center justify-center gap-2 rounded-full px-3 backdrop-blur-lg transition-opacity"
97+
class="bg-smooth hover:bg-smooth/50 flex h-full w-fit items-center justify-center gap-2 rounded-full px-0.5 backdrop-blur-lg transition-opacity sm:px-1 md:px-2 lg:px-3"
9798
>
9899
<span
99100
class="text-primary text-caption flex items-center justify-center gap-1 font-medium"
@@ -104,7 +105,7 @@
104105
alt={product.label}
105106
class="size-6"
106107
/>
107-
{product.label}
108+
<span class="hidden lg:inline">{product.label}</span>
108109
</span>
109110
</a>
110111
{/each}

src/routes/contact-us/+page.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
<form
143143
method="post"
144144
on:submit|preventDefault={handleSubmit}
145-
class="flex flex-col gap-4"
145+
class="mx-auto flex w-full max-w-xl flex-col gap-4"
146146
>
147147
<div class="flex justify-end">
148148
<ul
@@ -192,7 +192,7 @@
192192
</ul>
193193
</div>
194194
<div
195-
class="web-u-flex-vertical-reverse-mobile flex justify-between gap-4"
195+
class="web-u-flex-vertical-reverse-mobile mx-auto flex w-full max-w-xl justify-between gap-4"
196196
>
197197
<p class="text-caption web-u-max-width-380">
198198
{#if error}
@@ -210,7 +210,7 @@
210210
<Button
211211
type="submit"
212212
disabled={submitting}
213-
class="web-u-inline-width-100-percent-mobile-break1 self-center"
213+
class="w-full! self-center lg:w-auto!"
214214
>
215215
<span>Submit</span>
216216
</Button>

src/routes/startups/+page.svelte

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@
316316
<CaseStudiesLight />
317317

318318
<div id="form" class="web-white-section light overflow-hidden">
319-
<div class=" relative pt-20 pb-8 md:pt-40 md:pb-30">
319+
<div class="relative pt-20 pb-8 md:pt-40 md:pb-30">
320320
<div class="relative">
321321
<div class="relative container">
322322
<!-- before submit -->
@@ -402,7 +402,7 @@
402402
<form
403403
method="post"
404404
on:submit|preventDefault={handleSubmit}
405-
class="flex flex-col gap-4"
405+
class="mx-auto flex w-full max-w-xl flex-col gap-4"
406406
>
407407
<div class="flex justify-end">
408408
<ul
@@ -458,11 +458,12 @@
458458
</ul>
459459
</div>
460460
<div
461-
class="web-u-flex-vertical-reverse-mobile flex justify-between gap-4"
461+
class="web-u-flex-vertical-reverse-mobile mx-auto flex w-full max-w-xl justify-between gap-4"
462462
>
463463
<div class="flex flex-col gap-2">
464464
<p class="text-caption text-secondary">
465465
This form is protected by reCAPTCHA, and the Google <br
466+
class="hidden sm:block"
466467
/>
467468
<a
468469
href="https://policies.google.com/privacy"
@@ -484,7 +485,7 @@
484485
<Button
485486
type="submit"
486487
disabled={submitting}
487-
class="web-u-inline-width-100-percent-mobile-break1 self-center"
488+
class="w-full! self-center lg:w-auto!"
488489
>
489490
Get Started
490491
</Button>

src/routes/threads/ThreadCard.svelte

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
{#key highlightTerms}
1313
<a href="/threads/{thread.discord_id}" class="web-card is-normal has-border-gradient thread">
14-
<div class="flex gap-2">
14+
<div class="flex min-w-0 gap-2">
1515
<h3
16-
class="text-main-body text-primary font-medium break-words"
16+
class="text-main-body text-primary min-w-0 flex-1 font-medium"
1717
use:highlight={highlightTerms}
1818
>
1919
{thread.title}
@@ -22,23 +22,23 @@
2222
</div>
2323

2424
<p
25-
class="web-main-body-500 u-margin-block-start-4 u-break-word"
25+
class="web-main-body-500 u-margin-block-start-4 u-break-word min-w-0"
2626
use:highlight={highlightTerms}
2727
>
2828
{sanitizeContent(thread.content)}
2929
</p>
3030

31-
<div class="mt-4 flex justify-between gap-4">
32-
<ul class="flex gap-2">
33-
{#each thread.tags ?? [] as tag}
34-
<li>
35-
<div class="web-tag">{tag}</div>
31+
<div class="mt-4 flex min-w-0 flex-wrap justify-between gap-4">
32+
<ul class="flex min-w-0 flex-wrap gap-2">
33+
{#each thread.tags ?? [] as tag, index (tag + index)}
34+
<li class="min-w-0">
35+
<div class="web-tag truncate">{tag}</div>
3636
</li>
3737
{/each}
3838
</ul>
3939

4040
<div
41-
class="web-icon-button is-more-content web-u-pointer-events-none flex items-center"
41+
class="web-icon-button is-more-content web-u-pointer-events-none flex shrink-0 items-center"
4242
aria-label="Replies"
4343
>
4444
<span class="web-icon-message web-u-font-size-16" aria-hidden="true"></span>
@@ -51,13 +51,25 @@
5151
<style lang="scss">
5252
.web-card {
5353
padding: 1.25rem;
54+
overflow: hidden;
5455
}
5556
5657
.thread {
5758
position: relative;
59+
max-width: 100%;
60+
overflow-wrap: break-word;
61+
word-wrap: break-word;
5862
59-
p: {
63+
p {
6064
overflow-wrap: break-word;
65+
word-wrap: break-word;
66+
hyphens: auto;
67+
}
68+
69+
h3 {
70+
overflow-wrap: break-word;
71+
word-wrap: break-word;
72+
hyphens: auto;
6173
}
6274
}
6375
@@ -68,4 +80,11 @@
6880
h3 {
6981
margin-block-end: 0.25rem;
7082
}
83+
84+
.web-tag {
85+
max-width: 100%;
86+
overflow: hidden;
87+
text-overflow: ellipsis;
88+
white-space: nowrap;
89+
}
7190
</style>

0 commit comments

Comments
 (0)