fix: restrict html/body width and enforce strict viewport width on DialogContent

This commit is contained in:
2026-07-10 14:10:55 +00:00
parent 9b75c49ac2
commit 4433dd38e8
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ const DialogContent = React.forwardRef<
<DialogPrimitive.Content <DialogPrimitive.Content
ref={ref} ref={ref}
className={cn( className={cn(
"fixed left-4 right-4 translate-x-0 top-[50%] translate-y-[-50%] z-50 grid w-auto max-h-[90vh] overflow-y-auto gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:left-[50%] sm:translate-x-[-50%] sm:w-full sm:max-w-lg sm:rounded-lg", "fixed left-4 right-4 translate-x-0 top-[50%] translate-y-[-50%] z-50 grid w-[calc(100vw-2rem)] max-w-[calc(100vw-2rem)] max-h-[90vh] overflow-y-auto gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:left-[50%] sm:translate-x-[-50%] sm:w-full sm:max-w-lg sm:rounded-lg",
className className
)} )}
{...props} {...props}
+4
View File
@@ -134,6 +134,10 @@
* { * {
@apply border-border outline-ring/50; @apply border-border outline-ring/50;
} }
html, body {
max-width: 100vw;
overflow-x: hidden;
}
body { body {
@apply bg-background text-foreground; @apply bg-background text-foreground;
} }