fix: Polish React Toast background, description color and border radius - #1392
fix: Polish React Toast background, description color and border radius#1392amandaye0h wants to merge 3 commits into
Conversation
Align web Toast with the React Native light/dark surface treatment from #1391. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 850be70. Configure here.
📖 Storybook LinksCompare the preview for this pull request with the latest Storybooks from the 🔀 Pull Request Preview
🌳 Main Branch (Latest)
|
Co-authored-by: Cursor <cursoragent@cursor.com>
📖 Storybook LinksCompare the preview for this pull request with the latest Storybooks from the 🔀 Pull Request Preview
🌳 Main Branch (Latest)
|
Ensure nested light surfaces keep default background and shadow when inside a .dark ancestor, and cover callback refs plus theme edge cases. Co-authored-by: Cursor <cursoragent@cursor.com>
📖 Storybook LinksCompare the preview for this pull request with the latest Storybooks from the 🔀 Pull Request Preview
🌳 Main Branch (Latest)
|
|
Thanks for picking up the React parity for #1391 — the test coverage for the theme cases is solid. A few things to flag:
descriptionProps = { color: TextColor.TextAlternative },If a consumer passes any descriptionProps={{ color: TextColor.TextAlternative, ...descriptionProps }}Architectural concern — flagged in DSYS-932 This PR is one of the first instances in the design system where a component switches which token it uses based on the current theme ( Historically we haven't done this — the CSS token layer handles theming so components don't need to think about it. There are legitimate cases for this approach, but it carries risk if it spreads without guardrails (see the team message for context). It's also why we haven't needed a theme provider for React web before — and if we start applying colors this way more broadly, we'll need to build one to avoid fragile DOM-inspection patterns like the Tracking the exploration in DSYS-932 — the goal is to establish clear rules for when this is appropriate before it becomes a wider pattern. |

Description
Polish React
Toastsurface styling so it stays aligned with the React Native Toast treatment from #1391.Why: Toast was always using section background, 12px radius, and default description color, which didn’t match the desired visual spec.
What changed:
background.default+ medium shadow (shadow-md)background.section(no shadow)[data-theme]ancestor first; falls back to.dark, thendocument.documentElement(React has nouseThemelike RN). Nesteddata-theme="light"inside a distant.darkancestor keeps light polish.TextColor.TextAlternativerounded-xl) to 16px (rounded-2xl)Related issues
Related: #1391
Manual testing steps
yarn storybookand open Components → ToastScreenshots/Recordings
Before
Screen.Recording.2026-07-21.at.4.48.58.PM.mov
After
Screen.Recording.2026-07-21.at.4.49.58.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Visual and presentation-only changes to Toast with unit test coverage; no auth, data, or API behavior changes.
Overview
Aligns the React Toast surface with the RN treatment: light uses default background,
shadow-md, and 16px corners (rounded-2xl); dark uses section background with no shadow.Theme is resolved at runtime via
resolveIsDarkTheme(closest[data-theme], then.dark, thendocument.documentElement), with a MutationObserver so changes to theme attributes stay in sync. Nesteddata-theme="light"inside a.darkancestor keeps light styling.Description text now defaults to
TextColor.TextAlternativethroughdescriptionProps. Ref forwarding is merged into a callback ref so theme detection still works with object and function refs.Tests cover light/dark/nested theme classes, description color, and callback refs.
Reviewed by Cursor Bugbot for commit 101460d. Bugbot is set up for automated code reviews on this repo. Configure here.