Skip to content

Convert the default and initials avatars to CSS modules - #6028

Open
Eugene (OEvgeny) wants to merge 4 commits into
mainfrom
OEvgeny/fix-css-modules-avatars
Open

Eugene (OEvgeny) wants to merge 4 commits into
mainfrom
OEvgeny/fix-css-modules-avatars

Conversation

@OEvgeny

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

Copy link
Copy Markdown
Collaborator

Continues the CSS Modules migration (#5997, #6024) with the avatars.

Changelog Entry

Changed

  • Converted the default and initials avatars to CSS Modules with webchat__ class names; avatarBorderRadius, botAvatarBackgroundColor and userAvatarBackgroundColor are now custom properties, in PR #6028, by @OEvgeny

Removed

  • 💥 Deprecated the avatar and initialsAvatar style set entries, which no longer affect rendering, in PR #6028, by @OEvgeny

Description

The default and initials avatars move from emotion style sets to CSS Modules. No snapshot changes; rendered class names stay.

Design

  • avatarBorderRadius sets the reserved --webchat__border-radius--avatar; backgrounds use --webchat__background--avatar(-user) with the accent fallback in JavaScript (a CSS var() fallback would give Fluent avatars Fluent's accent).
  • One Avatar.module.css with 3 regions takes over ImageAvatar.module.css.

Specific Changes

  • DefaultAvatar, InitialsAvatar, ImageAvatar: Avatar/Avatar.module.css, InferReactProps
  • CustomPropertyNames.ts, CSSCustomPropertiesContainer.tsx: 3 avatar custom properties
  • createStyleSet.ts, StyleSet/{Avatar,InitialsAvatar}.ts: @deprecated
  • fluentCSSModuleTheme.module.css: stacked-loyout__bubble typo → stacked-layout__bubble, no visible change
  • styleOptions/avatarBorderRadius.html: new page, numeric radius (4 px corners)
  • DefaultAvatar.spec.tsx CSS mock; imageAvatar JSDoc paths
  • 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 6, 2026 15:38
Moves the avatar and initialsAvatar style set entries and the local emotion
styles of DefaultAvatar and InitialsAvatar into Avatar/Avatar.module.css, which
takes over ImageAvatar.module.css. Class names keep the webchat__ prefix.

avatarBorderRadius sets the reserved --webchat__border-radius--avatar; the
background colors set --webchat__background--avatar(-user), with the accent
fallback resolved in JavaScript. Deprecates both style set entries.
…us rule

The selector :global(.stacked-loyout__bubble) matched nothing, so the
message status in a copilot part group did not get the
fontSizeBase200/lineHeightBase200 of its sibling title and text.
@OEvgeny
Eugene (OEvgeny) marked this pull request as ready for review November 7, 2026 04:11
Copilot AI balanced review requested due to automatic review settings November 7, 2026 04:11

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.

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.

2 participants