File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ function AlertDialogOverlay({
3030 < AlertDialogPrimitive . Backdrop
3131 data-slot = "alert-dialog-overlay"
3232 className = { cn (
33- "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0" ,
33+ "fixed inset-0 isolate z-50 bg-black/50 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0" ,
3434 className
3535 ) }
3636 { ...props }
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ function DialogOverlay({
3131 < DialogPrimitive . Backdrop
3232 data-slot = "dialog-overlay"
3333 className = { cn (
34- "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0" ,
34+ "fixed inset-0 isolate z-50 bg-black/50 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0" ,
3535 className
3636 ) }
3737 { ...props }
Original file line number Diff line number Diff line change 1+ import { describe , it , expect } from "vitest" ;
2+ import { readFileSync } from "fs" ;
3+ import { join } from "path" ;
4+
5+ /**
6+ * Regression test for issue #47: dialog overlays must use bg-black/50
7+ * per the design spec. bg-black/10 is nearly invisible and breaks
8+ * the modal focus effect.
9+ */
10+ describe ( "dialog overlay opacity matches design spec" , ( ) => {
11+ const uiDir = join ( __dirname ) ;
12+
13+ it ( "DialogOverlay uses bg-black/50" , ( ) => {
14+ const source = readFileSync ( join ( uiDir , "dialog.tsx" ) , "utf-8" ) ;
15+ expect ( source ) . toContain ( "bg-black/50" ) ;
16+ expect ( source ) . not . toContain ( "bg-black/10" ) ;
17+ } ) ;
18+
19+ it ( "AlertDialogOverlay uses bg-black/50" , ( ) => {
20+ const source = readFileSync ( join ( uiDir , "alert-dialog.tsx" ) , "utf-8" ) ;
21+ expect ( source ) . toContain ( "bg-black/50" ) ;
22+ expect ( source ) . not . toContain ( "bg-black/10" ) ;
23+ } ) ;
24+ } ) ;
You can’t perform that action at this time.
0 commit comments