Skip to content

Commit dae09f8

Browse files
Merge pull request #137 from ygyg70/handle-mobie-safe-area
Add safe area inset to mobile top and bottom
2 parents 2b34424 + cd6e2c5 commit dae09f8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/packages/Toaster.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ function removeToast(toastToRemove: ToastT) {
233233
234234
// First remove toast
235235
toasts.value = toasts.value.filter(({ id }) => id !== toastToRemove.id)
236-
236+
237237
// Delay cleaning heights to give animation time to complete
238238
setTimeout(() => {
239239
// Ensure toast has been actually removed before cleaning heights
@@ -333,7 +333,7 @@ watchEffect((onInvalidate) => {
333333
/**
334334
* Helper function to update the actualTheme value
335335
* based on current media query match.
336-
*
336+
*
337337
* @param {boolean} matches - true if dark mode is preferred
338338
*/
339339
const updateTheme = (matches: boolean) => {
@@ -892,11 +892,11 @@ html[dir='rtl'],
892892
}
893893
894894
[data-sonner-toaster][data-y-position='bottom'] {
895-
bottom: var(--mobile-offset-bottom);
895+
bottom: calc(var(--mobile-offset-bottom) + max(env(safe-area-inset-bottom), 0px));
896896
}
897897
898898
[data-sonner-toaster][data-y-position='top'] {
899-
top: var(--mobile-offset-top);
899+
top: calc(var(--mobile-offset-top) + max(env(safe-area-inset-top), 0px));
900900
}
901901
902902
[data-sonner-toaster][data-x-position='center'] {

0 commit comments

Comments
 (0)