fix(sonner): make close button visible on light and dark toasts#3769
fix(sonner): make close button visible on light and dark toasts#3769RushikeshGandhmal wants to merge 3 commits intodubinc:mainfrom
Conversation
|
@RushikeshGandhmal is attempting to deploy a commit to the Dub Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded explicit CSS styling rules for Sonner toast close buttons to control their opacity, background color, text color, and border color across all toast themes using Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@steven-tey can you please review the PR? |
Description
Sonner's toast close button renders with
opacity: 0.4by default and inherits background/border colors from the toast theme. On light toasts the icon blends into the surface; on dark/colored toasts the inherited dark background makes the button nearly invisible.Changes
apps/web/styles/globals.css[data-sonner-toast] [data-close-button]opacity: 1,background: white,color: #374151, andborder-color: #e5e7ebso the close button is always visible regardless of toast themeWhy
Sonner doesn't expose a prop to control close button appearance per-theme. The only reliable fix is a CSS override scoped to the toast container — this avoids touching the Sonner internals while keeping the button consistent across all toast variants.
Screenshots
Before
After
Summary by CodeRabbit