Repository navigation
Convert the send box buttons to CSS modules - #6044
Merged
Eugene (OEvgeny) merged 10 commits intoNov 12, 2026
Merged
Conversation
added 9 commits
November 9, 2026 18:15
…phone color while dictating
…es-send-box-buttons # Conflicts: # packages/component/src/SendBox/SendBox.module.css # packages/component/src/Styles/CSSCustomPropertiesContainer.tsx # packages/component/src/Styles/CustomPropertyNames.ts
Eugene (OEvgeny)
marked this pull request as ready for review
November 12, 2026 19:50
Eugene (OEvgeny)
requested review from
William Wong (compulim),
Chris Whitten (cwhitten) and
Thomas Durnford (tdurnford)
as code owners
November 12, 2026 19:50
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Human browser verification is needed for snapshot parity, keyboard focus indicators, and forced-colors dictation styling because the dependency-free review environment cannot run the Selenium/HTML suite.
No open issues 🎉
What changed in this PR
Continues the CSS Modules migration by moving send box buttons and attachment icons off Emotion style sets while retaining their public webchat__ classes.
Changes:
- Moves button styling into CSS Modules and maps 18 style options to custom properties.
- Deprecates three legacy style set entries that no longer affect rendering.
- Adds visual tests for unset button-state options and microphone dictation colors.
| File | Description |
|---|---|
packages/component/src/Styles/StyleSet/UploadButton.ts |
Documents upload style set deprecation. |
packages/component/src/Styles/StyleSet/SendBoxButton.ts |
Documents button style set deprecation. |
packages/component/src/Styles/StyleSet/MicrophoneButton.ts |
Documents microphone style set deprecation. |
packages/component/src/Styles/CustomPropertyNames.ts |
Defines 18 button custom property names. |
packages/component/src/Styles/CSSCustomPropertiesContainer.tsx |
Maps button options to custom properties. |
packages/component/src/Styles/createStyleSet.ts |
Marks three legacy entries deprecated. |
packages/component/src/SendBoxToolbar/UploadButton.tsx |
Applies module classes to the upload control. |
packages/component/src/SendBoxToolbar/Assets/AttachmentIcon.tsx |
Migrates attachment styling and removes unused rules. |
packages/component/src/SendBox/SendButton.tsx |
Uses a module class for send-button placement. |
packages/component/src/SendBox/SendBox.module.css |
Adds button, attachment, and microphone styles. |
packages/component/src/SendBox/MicrophoneButton.tsx |
Applies module classes to microphone states. |
packages/component/src/SendBox/IconButton.tsx |
Migrates shared button and focus-indicator classes. |
.changelog/6044-fix-css-modules-send-box-buttons.md |
Records the migration and deprecations. |
__tests__/html2/styleOptions/sendBoxButton.undefined.html |
Covers unset state colors and button sizing. |
__tests__/html2/styleOptions/microphoneButton.undefined.html |
Runs the unset dictation-color variant. |
__tests__/html2/styleOptions/microphoneButton.html |
Covers explicit and unset dictation colors. |
Review effort: Balanced
William Wong (compulim)
approved these changes
Nov 12, 2026
Eugene (OEvgeny)
deleted the
OEvgeny/fix-css-modules-send-box-buttons
branch
November 12, 2026 23:29
2 of 11 tasks
Eugene (OEvgeny)
added a commit
that referenced
this pull request
Nov 14, 2026
…es (#6050) * Test the scroll to end button and file attachment style options New pages, with snapshots written on main (before the conversion): - styleOptions/transcriptOverlayButton: every scroll to end button option, idle, focused, focused and hovered, hovered. - styleOptions/transcriptOverlayButton.undefined: undefined focus and hover options fall back to the hover background or the base colors. - styleOptions/fileContent: padding, font, accent and bubble text color on a downloadable file and a file without a URL, idle and with the link focused. - rtl/fileContent: the download icon on the left in right-to-left. - scrollToEndButton/forcedColors: the button border in forced colors. * Convert the scroll to end button and the file attachment to CSS modules Moves the scrollToEndButton and fileContent style set entries to ScrollToEndButton.module.css and FileContent.module.css, with the webchat__ class names (useStyles with webChatPrefixedClassName). - scrollToEndButtonFontSize becomes --webchat__font-size--scroll-to-end-button (numbers get px through toLength()); the other options reuse existing custom properties. - The hover and focus backgrounds of the transcript overlay button are unset when not set, so the button falls back to the hover or base background as the emotion rules did. A focus:hover rule keeps the hover background when the focus background is not set. - The 2 entries are @deprecated (removal on or after 2028-10-16). * Use a logical margin for the file download icon in right-to-left The download icon gets margin-inline-start instead of margin-left, or margin-right with the webchat__fileContent__downloadIcon--rtl class, so FileContent no longer needs useDirection(). Same pixels (rtl/fileContent). * Update the Fluent snapshots that show a file attachment With the Fluent theme, the file attachment now uses Fluent's padding token (8 pixels instead of 10) for itself and its download icon, so the attachment is 4 pixels shorter (8 with a download icon) and the transcript above it moves by the same amount. Fluent's font token also applies, which renders the same in the test browser. - attachment/file.noName.fluent: snapshot 1 - side-by-side/transcript.navigation.fluent(.dark): snapshots 1-9 * Say which scroll to end button snapshots repeat the previous one * Say the forced colors scroll to end button border is outset * Use orUnset() for the transcript overlay button hover and focus backgrounds #6044 added orUnset() while this branch wrote the same fallback inline as `|| 'unset'`. Same output (an unset option still becomes `unset`, so the module's var() fallback applies), one helper for every state option. * Add the changelog fragment * Add the Changed entry to the changelog fragment * Re-take the side-by-side snapshots for the 4 px shorter Fluent file attachment --------- Co-authored-by: Eugene Olonov <eugeneolonov@microsoft.com>
2 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog Entry
Changed
webchat__class names and their style options to custom properties, in PR #6044, by @OEvgenyRemoved
microphoneButton,sendBoxButtonanduploadButtonstyle set entries, which no longer affect rendering, in PR #6044, by @OEvgenyDescription
The send box icon, upload and microphone buttons and the attachment icon move from emotion to CSS Modules without snapshot changes. Their 18 style options become custom properties; 3 style set entries are deprecated.
Design
var(), as emotion did. The button size reuses the send box height property.webchat__class stays; the send box grid places the upload and send buttons with module classes..icon > svgfills,gridTemplateArea(not a CSS property) and__checkmark-icon.Specific Changes
SendBox/SendBox.module.css: icon button, upload button, attachment icon and microphone button regionsCSSCustomPropertiesContainer.tsx,CustomPropertyNames.ts: 18 new propertiesIconButton,SendButton,MicrophoneButton,UploadButton,AttachmentIcon:useStyles()createStyleSet.ts, 3StyleSet/*.ts:@deprecatedstyleOptions/sendBoxButton.undefined.html: snapshots 1–5, base colors in every state but hover (same before)styleOptions/microphoneButton.html(+.undefined): dictating icon color, set and not set (same before).changelog/<PR#>-<slug>.mdReview Checklist
z-index)package.jsonandpackage-lock.jsonreviewed