From 3d7872bdcf498754e398616fb7473abda3ab4d00 Mon Sep 17 00:00:00 2001 From: yyh Date: Mon, 2 Mar 2026 15:01:08 +0800 Subject: [PATCH] refactor(web): simplify z-index to rely on isolation + DOM order Remove z-index tokens from tailwind config. With root `isolation: isolate`, portaled overlays naturally sit above app content via DOM order. - Tooltip / Popover / Dropdown: no z-index needed - Dialog: z-50 (modal must cover non-modal portals) - Toast: z-[99] (always on top, defined in toast component) --- web/app/components/base/ui/dialog/index.tsx | 9 +++++++-- web/app/components/base/ui/dropdown-menu/index.tsx | 4 ++-- web/app/components/base/ui/popover/index.tsx | 2 +- web/app/components/base/ui/tooltip/index.tsx | 2 +- web/tailwind-common-config.ts | 7 ------- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/web/app/components/base/ui/dialog/index.tsx b/web/app/components/base/ui/dialog/index.tsx index 07d1e1f649..61b9309138 100644 --- a/web/app/components/base/ui/dialog/index.tsx +++ b/web/app/components/base/ui/dialog/index.tsx @@ -1,5 +1,10 @@ 'use client' +// z-index strategy (relies on root `isolation: isolate` in layout.tsx): +// Tooltip / Popover / Dropdown — no z-index, DOM order is sufficient +// Dialog backdrop + popup — z-50, ensures modal covers non-modal portals +// Toast — z-[99], always on top (defined in toast component) + import { Dialog as BaseDialog } from '@base-ui/react/dialog' import * as React from 'react' import { cn } from '@/utils/classnames' @@ -25,14 +30,14 @@ export function DialogContent({