fix(mobile): constrain h5 shell width

This commit is contained in:
2026-07-09 14:15:24 +08:00
parent e60520b7aa
commit ac9f640f7f
2 changed files with 47 additions and 0 deletions
@@ -440,7 +440,9 @@ onShow(() => {
}
.login-button {
flex: 0 0 84px;
min-width: 84px;
white-space: nowrap;
}
.section-head,
+45
View File
@@ -5,6 +5,10 @@ page {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root {
--mobile-shell-max-width: 430px;
}
view,
text,
input,
@@ -154,3 +158,44 @@ button::after {
color: #64748b;
text-align: center;
}
@media (min-width: 520px) {
:root {
--mobile-shell-side-offset: calc((100vw - var(--mobile-shell-max-width)) / 2);
}
body {
background: #e5e7eb;
}
uni-app,
uni-page,
uni-page-body {
width: 100%;
max-width: var(--mobile-shell-max-width);
margin-right: auto;
margin-left: auto;
}
uni-app {
min-height: 100vh;
background: #f5f7fb;
box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}
uni-tabbar.uni-tabbar-bottom {
right: var(--mobile-shell-side-offset);
left: var(--mobile-shell-side-offset);
width: auto;
max-width: none;
transform: none;
}
uni-tabbar.uni-tabbar-bottom .uni-tabbar {
right: var(--mobile-shell-side-offset);
left: var(--mobile-shell-side-offset);
width: auto;
max-width: none;
transform: none;
}
}