Skip to main content

Lovable Prompt

Use CSS variables for safe area handling in your application. The Despia native runtime automatically provides var(--safe-area-top) and var(--safe-area-bottom) CSS variables.
  1. Add spacer divs at the top and bottom of your layout
  2. Set the height of spacer divs to var(--safe-area-top) and var(--safe-area-bottom)
  3. Use CSS variables in padding or height styles for fixed positioned elements
  4. Ensure fixed positioned elements respect device boundaries
  5. Handle device notches, status bars, and home indicators automatically
This feature is automatically provided by the Despia Native runtime - no npm package installation required!
Please follow the implementation instructions closely. The CSS variables are injected by the Despia Native runtime environment.
Use these CSS variables to keep controls clear of system bars and cutouts.

Foldable devices

Rebuild your app with the latest Despia V3 runtime to use foldable support. For a fullscreen Lovable app, ask Lovable to add viewport-fit=cover to the existing viewport meta tag and add each of the four inset values to the matching edge of headers, footers, and floating controls. Keep the background full bleed. Use current window width for breakpoints so the layout also works on the outer iPhone Duo display and in narrow windows. For steps, a complete example, and the Android hinge API, see Foldable devices.

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) and var(--safe-area-bottom)
  • Automatically provided by Despia Native runtime
  • No external packages or configuration needed

Lovable Integration

Despia feeds the current safe-area insets into your CSS. Apply them to the parts of the layout that contain controls or text. For additional support or questions about safe area implementation, please contact our support team at support@despia.com