fix(ios): set background color for safe area behind home indicator

- Add backgroundColor to Capacitor iOS config to fill safe area
- Add CSS :has() rules to set html background based on theme class
This commit is contained in:
johannesjo 2026-01-16 17:24:47 +01:00
parent ae0ca10c57
commit d91d5e892b
2 changed files with 13 additions and 0 deletions

View file

@ -26,6 +26,9 @@ const config: CapacitorConfig = {
ios: {
// Content inset for safe areas (notch, home indicator)
contentInset: 'automatic',
// Background color for safe areas (home indicator, notch)
// Use dark color to match dark theme (most common on mobile)
backgroundColor: '#131314',
// Allow inline media playback
allowsLinkPreview: true,
// Scroll behavior

View file

@ -21,6 +21,16 @@ html {
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
// Set html background for iOS safe area (home indicator)
// Uses :has() to match body theme class since --bg is defined on body
&:has(body.isLightTheme) {
background: #f8f8f7;
}
&:has(body.isDarkTheme) {
background: #131314;
}
button,
a {
-webkit-app-region: no-drag !important;