Lovable Prompt
Use CSS variables for safe area handling in your application. The Despia native runtime automatically provides Please follow the implementation instructions closely. The CSS variables are injected by the Despia Native runtime environment.
var(--safe-area-top) and var(--safe-area-bottom) CSS variables.- Add spacer divs at the top and bottom of your layout
- Set the height of spacer divs to
var(--safe-area-top)andvar(--safe-area-bottom) - Use CSS variables in padding or height styles for fixed positioned elements
- Ensure fixed positioned elements respect device boundaries
- Handle device notches, status bars, and home indicators automatically
This feature is automatically provided by the Despia Native runtime - no npm package installation required!
var(--safe-area-top) and var(--safe-area-bottom)) for safe area handling. When you deploy and run the generated app in the Despia native runtime, these CSS variables are automatically populated with accurate safe area measurements including iPhone notches, status bars, home indicators, and other device-specific UI elements. The values are updated in real-time when the device orientation changes, ensuring your app content is never obscured by system UI elements.
Installation
No installation required! The CSS variables are automatically provided by the Despia native runtime.Usage 1.
Top Safe Area Spacer
2. Safe Area Implementation
Resources
- CSS Variables:
var(--safe-area-top)andvar(--safe-area-bottom) - Automatically provided by Despia Native runtime
- No external packages or configuration needed