Skip to content

Convert the toasts to CSS modules - #6031

Merged
Eugene (OEvgeny) merged 4 commits into
mainfrom
OEvgeny/fix-css-modules-toasts
Nov 10, 2026
Merged

Eugene (OEvgeny) merged 4 commits into
mainfrom
OEvgeny/fix-css-modules-toasts

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Continues the CSS Modules migration (#5997, #6024, #6028, #6030) with the toasts.

Changelog Entry

Changed

  • Converted the toasts to CSS Modules with webchat__ class names and their style options to custom properties, in PR #6031, by @OEvgeny

Removed

  • 💥 Deprecated the toast and toaster style set entries, which no longer affect rendering, in PR #6031, by @OEvgeny

Fixed

  • Fixed the toaster not mirroring in right-to-left languages, in PR #6031, by @OEvgeny

Description

The toasts move from emotion style sets to CSS Modules without snapshot changes; a second commit makes the toaster follow right-to-left languages.

Design

Specific Changes

  • Toast/Toast.module.css: toaster and toast
  • CSSCustomPropertiesContainer.tsx: 15 properties (11 new names)
  • BasicToast.js, BasicToaster.js: useStyles(), toaster dir
  • createStyleSet.ts, StyleSet/Toast{,er}.ts: @deprecated
  • styleOptions/toast.html: all options (same on main)
  • rtl/toaster.html: mirrored toaster
  • I have added tests and executed them locally
  • I have added .changelog/<PR#>-<slug>.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Eugene Olonov added 4 commits November 9, 2026 00:40
Moves the toast and toaster style set entries, and the local emotion styles of
BasicToast and BasicToaster, to Toast/Toast.module.css, with the webchat__
class names (useStyles with webChatPrefixedClassName).

- The 15 toast style options become custom properties (4 names were reserved);
  lengths get px through toLength().
- Classes without a rule stay plain strings: webchat__toast__icon,
  webchat__toaster__expandLevelIcon, webchat__toaster__notifications.
- Dropped the toaster's "> ul { height: 0 }" rule: the list is a div and is not
  rendered while collapsed, so it never matched.
- The toaster header keeps text-align: left, as on main.
- The 2 entries are @deprecated (removal on or after 2028-10-16).
- New test: styleOptions/toast.html sets every toast option.
On main, the toaster had no dir, so in a right-to-left locale it stayed
left-to-right (level icon on the left, dismiss and expand buttons on the
right), unlike the transcript, send box and connectivity status. When a host
page set dir="rtl", the header's text-align: left put its text next to the
expand button instead of the level icon.

The toaster now sets dir from useDirection() and its header uses
text-align: start. New test: rtl/toaster.html.
@OEvgeny
Eugene (OEvgeny) marked this pull request as ready for review November 9, 2026 10:23
Copilot AI balanced review requested due to automatic review settings November 9, 2026 10:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@OEvgeny
Eugene (OEvgeny) merged commit 9ee9c6d into main Nov 10, 2026
46 checks passed
@OEvgeny
Eugene (OEvgeny) deleted the OEvgeny/fix-css-modules-toasts branch November 10, 2026 00:17
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.

3 participants