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">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<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>
|
<title>Onyx</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
import TasksScreen from "./lib/screens/TasksScreen.svelte";
|
import TasksScreen from "./lib/screens/TasksScreen.svelte";
|
||||||
|
|
||||||
const isLinux = platform() === "linux";
|
const isLinux = platform() === "linux";
|
||||||
|
const isMobile = platform() === "android" || platform() === "ios";
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
app.loadConfig();
|
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="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:rounded-xl={isLinux}
|
||||||
class:linux-window-border={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}
|
{#if app.error}
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue