Skip to content

[Bug Fix] Overlays: use shadcn's nova overlay on every modal - #572

Open
leonardo-vsilva wants to merge 1 commit into
ruby-ui:mainfrom
leonardo-vsilva:fix/modal-overlay
Open

leonardo-vsilva wants to merge 1 commit into
ruby-ui:mainfrom
leonardo-vsilva:fix/modal-overlay

Conversation

@leonardo-vsilva

@leonardo-vsilva leonardo-vsilva commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

No existing issue — happy to open one if you'd prefer to track it there.

Description

The four modal overlays each paint a different backdrop: Dialog, Sheet and CommandDialog use the theme background at 80% with a blur (a light veil in light mode), while AlertDialog uses black at 80% with a blur.

shadcn's current default style (nova, apps/v4/registry/styles/style-nova.css) gives every overlay — .cn-dialog-overlay, .cn-alert-dialog-overlay, .cn-sheet-overlay, .cn-drawer-overlay — the same value: bg-black/10 supports-backdrop-filter:backdrop-blur-xs, black in both themes with no .dark override, blurred only where backdrop-filter is supported. This applies it to all four:

  • DialogContent: backdrop:bg-black/10 backdrop:supports-backdrop-filter:backdrop-blur-xs on the native <dialog>'s ::backdrop;
  • AlertDialogContent, SheetContent, CommandDialogContent: bg-black/10 supports-backdrop-filter:backdrop-blur-xs on the overlay div.

Classes stay inline rather than in a shared @utility, since ruby_ui:component never touches the app's stylesheet and existing installs would lose the overlay. Tailwind compiles bg-black/10 with a literal #0000001a fallback, so the color holds even where ::backdrop doesn't see the theme's custom properties.

Each component gets a test pinning the overlay, and mcp/data/registry.json is rebuilt (cd mcp && bundle exec rake mcp:build).

In dark mode the change is barely visible (10% black over a near-black page), so the screenshots below are light mode.

Before After
Dialog before-dialog Dialog after-dialog
AlertDialog before-alert_dialog AlertDialog after-alert_dialog
Sheet before-sheet Sheet after-sheet
CommandDialog before-command CommandDialog after-command

Testing instructions

  1. cd gem && bundle exec rake — 298 runs, 0 failures; standardrb clean across 402 files.
  2. cd docs && bin/dev, open /docs/dialog, /docs/alert_dialog, /docs/sheet and /docs/command (⌘K): each overlay is the same faint black veil with a light blur, in light and dark mode.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 9 files

View guided diff | Re-trigger cubic

Each modal paints its own backdrop: Dialog, Sheet and CommandDialog
use the theme background at 80% with a blur, a light veil in light
mode, while AlertDialog uses black at 80%. None of them matches
shadcn, whose default nova style gives every overlay the same value.

Use that value on all four: `bg-black/10` with
`supports-backdrop-filter:backdrop-blur-xs`, black in both themes and
blurred only where the browser supports it. Dialog takes it through
the `backdrop:` variant on its native `<dialog>`. Keep the classes
inline, since `ruby_ui:component` never touches the app's stylesheet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant