Add safe area insets for mobile status bar and navigation
Add viewport-fit=cover to the viewport meta tag and apply env(safe-area-inset-top/bottom) padding on mobile platforms. This prevents the app header from being obscured by the Android status bar, camera notch, and bottom gesture navigation area.
This commit is contained in:
parent
192b449e87
commit
633337da4e
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
||||
<title>Onyx</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
import TasksScreen from "./lib/screens/TasksScreen.svelte";
|
||||
|
||||
const isLinux = platform() === "linux";
|
||||
const isMobile = platform() === "android" || platform() === "ios";
|
||||
|
||||
onMount(() => {
|
||||
app.loadConfig();
|
||||
|
|
@ -18,7 +19,7 @@
|
|||
class="relative h-full w-full overflow-hidden bg-surface-light text-text-light dark:bg-surface-dark dark:text-text-dark"
|
||||
class:rounded-xl={isLinux}
|
||||
class:linux-window-border={isLinux}
|
||||
style="container-type: inline-size"
|
||||
style="container-type: inline-size{isMobile ? '; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom)' : ''}"
|
||||
>
|
||||
{#if app.error}
|
||||
<div
|
||||
|
|
|
|||
Loading…
Reference in a new issue