fix(css): fill mobile safe-area zones with background color

Use fixed ::before and ::after pseudo-elements to render the
background color in safe-area inset zones, preventing transparent
gaps on notched mobile devices while maintaining body padding for
content flow.
This commit is contained in:
2026-05-24 22:41:15 +08:00
parent 86cbd56a99
commit 737eb2aea2
+20
View File
@@ -134,6 +134,26 @@ html.mobile {
--safe-bottom: env(safe-area-inset-bottom, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
} }
html.mobile body::before,
html.mobile body::after {
content: "";
position: fixed;
left: 0;
right: 0;
z-index: 9999;
background: var(--background);
}
html.mobile body::before {
top: 0;
height: var(--safe-top);
}
html.mobile body::after {
bottom: 0;
height: var(--safe-bottom);
}
html.mobile body { html.mobile body {
padding-top: var(--safe-top); padding-top: var(--safe-top);
padding-bottom: var(--safe-bottom); padding-bottom: var(--safe-bottom);