Skip to content

Commit f6a6c59

Browse files
committed
Fix mobile title bar responsiveness
1 parent 07af2a7 commit f6a6c59

1 file changed

Lines changed: 80 additions & 2 deletions

File tree

src/components/app/app.css

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@
5656

5757
.header {
5858
width: 100%;
59-
padding: 20px 0 20px 0;
59+
padding: 20px max(12px, env(safe-area-inset-right)) 20px
60+
max(12px, env(safe-area-inset-left));
6061
display: flex;
62+
flex-wrap: wrap;
6163
justify-content: center;
6264
align-items: center;
6365
gap: 10px;
66+
box-sizing: border-box;
6467

6568
position: sticky;
6669
top: 0px;
@@ -75,6 +78,7 @@
7578
z-index: 3;
7679

7780
.name {
81+
flex: 0 0 auto;
7882
font-weight: 700;
7983
}
8084

@@ -84,7 +88,81 @@
8488
}
8589

8690
& sl-input {
87-
width: 560px;
91+
/* Let the URL field keep its desktop width while still yielding on phones. */
92+
flex: 1 1 280px;
93+
width: clamp(220px, 48vw, 560px);
94+
max-width: 560px;
95+
min-width: 0;
96+
}
97+
}
98+
99+
@media (max-width: 640px) {
100+
.header {
101+
justify-content: flex-start;
102+
align-items: center;
103+
gap: 8px;
104+
padding: 10px max(10px, env(safe-area-inset-right)) 14px
105+
max(10px, env(safe-area-inset-left));
106+
107+
.name,
108+
& sl-input {
109+
width: 100%;
110+
}
111+
112+
& sl-input {
113+
/* Put the long URL field on its own row so action buttons stay tappable. */
114+
flex-basis: 100%;
115+
max-width: 100%;
116+
order: 2;
117+
}
118+
119+
.button-load,
120+
.button-menu {
121+
/* Override the desktop 100% button height so mobile controls stay compact. */
122+
height: 32px;
123+
justify-content: center;
124+
order: 3;
125+
}
126+
127+
.button-load {
128+
flex: 1 1 max-content;
129+
min-width: 0;
130+
}
131+
132+
.button-menu {
133+
flex: 0 0 32px;
134+
padding-inline: 0;
135+
order: 4;
136+
}
137+
138+
.menu-container {
139+
left: auto;
140+
right: 0;
141+
}
142+
}
143+
144+
.content {
145+
/* The desktop side gutters clip labels on phones, so the center column
146+
becomes the only layout column below the mobile breakpoint. */
147+
display: block;
148+
padding: 0 max(10px, env(safe-area-inset-right)) 0
149+
max(10px, env(safe-area-inset-left));
150+
box-sizing: border-box;
151+
}
152+
153+
.content-left,
154+
.content-right {
155+
display: none;
156+
}
157+
158+
.content-center {
159+
align-items: stretch;
160+
}
161+
162+
.content-center .grid-header {
163+
align-self: stretch;
164+
max-width: 100%;
165+
padding-right: 0;
88166
}
89167
}
90168

0 commit comments

Comments
 (0)