From bcfa4b74a9713be764ecb6db93d60d1360e52f07 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Fri, 11 Oct 2024 00:08:17 +0200 Subject: [PATCH] fix(Drawer/Modal/Slideover): no need for `z-index` since its isolated Resolves nuxt/ui#2347 --- src/theme/drawer.ts | 4 +- src/theme/modal.ts | 4 +- src/theme/slideover.ts | 4 +- .../__snapshots__/Drawer.spec.ts.snap | 62 +++++++-------- .../__snapshots__/Modal.spec.ts.snap | 70 ++++++++--------- .../__snapshots__/Slideover.spec.ts.snap | 78 +++++++++---------- 6 files changed, 111 insertions(+), 111 deletions(-) diff --git a/src/theme/drawer.ts b/src/theme/drawer.ts index 06e23170e0..cdc474eb4d 100644 --- a/src/theme/drawer.ts +++ b/src/theme/drawer.ts @@ -1,7 +1,7 @@ export default { slots: { - overlay: 'fixed inset-0 z-50 bg-[--ui-bg-elevated]/75', - content: 'fixed z-50 bg-[--ui-bg] ring ring-[--ui-border] flex focus:outline-none', + overlay: 'fixed inset-0 bg-[--ui-bg-elevated]/75', + content: 'fixed bg-[--ui-bg] ring ring-[--ui-border] flex focus:outline-none', handle: 'shrink-0 rounded-full bg-[--ui-bg-accented]', container: 'w-full flex flex-col gap-4 p-4 overflow-y-auto', header: '', diff --git a/src/theme/modal.ts b/src/theme/modal.ts index c4d6a0e307..f0cd246f48 100644 --- a/src/theme/modal.ts +++ b/src/theme/modal.ts @@ -1,7 +1,7 @@ export default { slots: { - overlay: 'fixed inset-0 z-50 bg-[--ui-bg-elevated]/75', - content: 'fixed z-50 w-full h-dvh bg-[--ui-bg] divide-y divide-[--ui-border] flex flex-col focus:outline-none', + overlay: 'fixed inset-0 bg-[--ui-bg-elevated]/75', + content: 'fixed w-full h-dvh bg-[--ui-bg] divide-y divide-[--ui-border] flex flex-col focus:outline-none', header: 'px-4 py-5 sm:px-6', body: 'flex-1 p-4 sm:p-6', footer: 'flex items-center gap-1.5 p-4 sm:px-6', diff --git a/src/theme/slideover.ts b/src/theme/slideover.ts index e4eba4863c..3f87a9ac91 100644 --- a/src/theme/slideover.ts +++ b/src/theme/slideover.ts @@ -1,7 +1,7 @@ export default { slots: { - overlay: 'fixed inset-0 z-50 bg-[--ui-bg-elevated]/75', - content: 'fixed z-50 bg-[--ui-bg] divide-y divide-[--ui-border] sm:ring ring-[--ui-border] sm:shadow-lg flex flex-col focus:outline-none', + overlay: 'fixed inset-0 bg-[--ui-bg-elevated]/75', + content: 'fixed bg-[--ui-bg] divide-y divide-[--ui-border] sm:ring ring-[--ui-border] sm:shadow-lg flex flex-col focus:outline-none', header: 'px-4 py-5 sm:px-6', body: 'flex-1 overflow-y-auto p-4 sm:p-6', footer: 'flex items-center gap-1.5 p-4 sm:px-6', diff --git a/test/components/__snapshots__/Drawer.spec.ts.snap b/test/components/__snapshots__/Drawer.spec.ts.snap index 3ea2106282..43a08b9f35 100644 --- a/test/components/__snapshots__/Drawer.spec.ts.snap +++ b/test/components/__snapshots__/Drawer.spec.ts.snap @@ -5,8 +5,8 @@ exports[`Drawer > renders with body slot correctly 1`] = ` -
-