Skip to content

Commit 38faedb

Browse files
calebmeyerCaleb Meyer
andauthored
Fix mobile layout (#14)
Sets the width from 40em (40 capital `M` wide) to 90% of the viewport width on mobile. Fixes #13 <img width="2335" alt="image" src="https://github.com/user-attachments/assets/fd28cecd-0143-4854-b4c7-8c106f4eafe7" /> <img width="2557" alt="image" src="https://github.com/user-attachments/assets/af1e0ce6-7bb7-467b-aef6-4f077be339e7" /> Code blocks are scrollable: <img width="416" alt="image" src="https://github.com/user-attachments/assets/41434315-7a1d-4a89-9c40-656b07cbb1c8" /> Also wanted to say while I'm here: Thank you for bevy lint! Co-authored-by: Caleb Meyer <Caleb.Meyer@Hy-Vee.com>
1 parent fc89fff commit 38faedb

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/routes/+layout.svelte

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,21 @@
3636
grid-template-columns: 1fr 2fr;
3737
}
3838
39+
/* Prevent elements that cannot wrap from stealing screen space from the nav bar. */
40+
.container main {
41+
max-width: 40em;
42+
}
43+
3944
/* When on mobile, switch to a single-column grid. */
4045
@media (width <= 820px) {
4146
.container {
4247
grid-template-columns: 1fr !important;
4348
}
44-
}
4549
46-
/* Prevent elements that cannot wrap from stealing screen space from the nav bar. */
47-
.container main {
48-
max-width: 40em;
50+
.container main {
51+
/* 90% of the viewport width */
52+
max-width: 90vw;
53+
}
4954
}
55+
5056
</style>

0 commit comments

Comments
 (0)