cordova-plugin-android-notch icon indicating copy to clipboard operation
cordova-plugin-android-notch copied to clipboard

WebView forward compatibility issues

Open dpogue opened this issue 8 months ago • 0 comments

I wanted to flag that the way the variables are set up in the README examples will cause issues in future versions of the Android WebView if they do support env(safe-area-inset-...) properly, because the padding will be applied twice.

Rather than adding, like the examples do:

/* BAD: Will potentially double the padding */
padding-top: env(safe-area-inset-top, 0px) + var(--notch-inset-top);

It would be better to use the CSS max() function to pick the larger of the values:

/* GOOD: Will pick the larger of the padding values */
padding-top: max(env(safe-area-inset-top, 0px), var(--notch-inset-top));

dpogue avatar Mar 01 '25 05:03 dpogue