Skip to content

Commit dc2660d

Browse files
committed
fix(mobile): fix floating offsets
1 parent 829fba1 commit dc2660d

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

src/components/AppComponent.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ const onBack = () => {
247247
248248
&.floating {
249249
header {
250-
top: 1rem;
250+
top: layout.$floating-navbar-offset;
251251
left: calc(50% - var(--max-header-width) / 2);
252252
width: var(--max-header-width);
253253
}

src/components/common/navbar/NavbarComponent.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ nav {
251251
252252
&.reverse {
253253
flex-direction: column-reverse;
254-
padding: 0 0.25rem env(safe-area-inset-bottom);
254+
padding: 0 0.25rem;
255255
}
256256
257257
&.floating {

src/components/views/settings/SettingsComponent.vue

+5-12
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,10 @@ onDeactivated(() => {
176176
177177
.container {
178178
width: 100%;
179-
height: layout.$safe-full-height;
179+
height: var(--full-height);
180180
margin-top: calc(0% - #{layout.$safe-navbar-height});
181181
background: transparent;
182-
transition:
183-
height 0.5s var(--n-bezier),
184-
margin-top 0.5s var(--n-bezier);
182+
transition: margin-top 0.5s var(--n-bezier);
185183
186184
.card {
187185
@include mixin.hover-background($from: var(--bg-black-50), $to: var(--bg-color-80));
@@ -213,12 +211,10 @@ onDeactivated(() => {
213211
.menu {
214212
@include mixin.hover-background;
215213
216-
height: layout.$safe-content-height;
217214
padding: 0.5rem;
218215
}
219216
220217
.content {
221-
height: layout.$safe-full-height;
222218
background: transparent;
223219
transition:
224220
height 0.5s var(--n-bezier),
@@ -231,17 +227,14 @@ onDeactivated(() => {
231227
}
232228
233229
&.floating {
234-
height: layout.$floating-content-height;
235230
margin-top: calc(0% - #{layout.$safe-area-inset-top});
236231
237-
.content {
238-
height: calc(#{layout.$floating-content-height} - 0.75rem);
239-
margin-top: calc(0.75rem + #{layout.$safe-area-inset-top});
232+
.content .card:first-child {
233+
margin-top: layout.$floating-navbar-height;
240234
}
241235
242236
.menu {
243-
height: layout.$floating-content-height;
244-
margin-top: layout.$safe-area-inset-top;
237+
margin-top: 0;
245238
padding-top: 1.5rem;
246239
}
247240
}

src/styles/layout.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ $safe-content-height: calc(var(--full-height) - #{$safe-navbar-height});
1313
$safe-full-height: calc(var(--full-height) - #{$safe-area-inset-top});
1414

1515
// floating navbar
16-
$floating-navbar-offset: 1rem;
17-
$floating-navbar-height: calc(#{$floating-navbar-offset} + #{$safe-navbar-height});
16+
$floating-navbar-offset: calc(1rem + #{$safe-area-inset-top / 3});
17+
$floating-navbar-height: calc(#{$floating-navbar-offset} + #{$header-navbar-height});
1818
$floating-open-drawer-height: calc(#{$floating-navbar-height} + #{$header-drawer-height});
1919
$floating-content-height: $safe-full-height;
2020

0 commit comments

Comments
 (0)