Repository navigation
Fluent: style Web Chat elements through the CSS module theme - #5993
Conversation
FluentThemeProvider wraps everything in <CSSModuleThemeComposer> with Fluent's class names for the Web Chat local names it styles, so Fluent rules select the feedback button and form by local name instead of :global() readable class names. fluentCSSModuleOverrides.spec.ts checks the lists against the CSS.
…e CSS module theme No Fluent CSS module selects a Web Chat CSS module class through :global() anymore; fluentCSSModuleOverrides.spec.ts now checks this for every Fluent CSS module.
… through the CSS module theme
… as a root dev dependency Same version as the one unplugin-lightningcss already installs (1.32.0), so the lock file only gains the root entry.
Read local names with the build's CSS modules options, so grid-area names are not counted. pickCSSModule() reads the CSS module through a Map instead of a computed property.
…-preserve-reason Lightning CSS drops empty rules and their class names. A rule that only declares a class name for themes now says why with "--webchat-preserve-reason: target-class"; once the class map is built, the shared CSS plugin removes the declaration, and the rule if it becomes empty, from the CSS.
…de modules Rules move verbatim from Theme.module.css to overrides/FeedbackForm.module.css and overrides/ThumbButton.module.css, one per Web Chat CSS module. FluentThemeProvider passes override modules whole to the CSS module theme, so their local names need no list; the spec checks they only use Web Chat local names and Fluent's own scoping names.
Rules move verbatim from PartGroupingDecorator.module.css and Theme.module.css to overrides/CodeBlock.module.css, CodeBlockContent.module.css, CodeBlockCopyButton.module.css and ViewCodeDialog.module.css.
Rules move verbatim from SendBox.module.css and Theme.module.css to overrides/AttachmentBar.module.css, AttachmentBarItem.module.css, FilePreview.module.css and TextArea.module.css.
Rules move verbatim from Theme.module.css to overrides/TranscriptFocus.module.css.
Rules move verbatim from PartGroupingDecorator.module.css and Theme.module.css to overrides/ActivityStatus.module.css, BorderFlair.module.css, Bubble.module.css, CarouselFilmStrip.module.css, ComponentIcon.module.css, MessageStatusLoader.module.css and StackedLayout.module.css.
Rules move verbatim from PartGroupingDecorator.module.css and Theme.module.css to overrides/ActivityButton.module.css, CollapsibleContent.module.css, CollapsibleGrouping.module.css and PartGroupingActivity.module.css.
Rules move verbatim from PartGroupingDecorator.module.css and Theme.module.css to overrides/LinkDefinitions.module.css, RenderMarkdown.module.css and TextContent.module.css.
…e modules Rules move verbatim from PartGroupingDecorator.module.css and Theme.module.css to overrides/AdaptiveCardRenderer.module.css and AnimatedImageContent.module.css.
…ery Fluent override is in an override module fluentCSSModuleTheme.spec.ts checks that only override modules use Web Chat local names, that each mirrors a Web Chat CSS module, and that FluentThemeProvider passes each of them.
…ride The thumb rule for hover and a focused text area input had landed in its own TextArea override, which loads after the rest of the block: with the same specificity as the thumb hover rule, it won. The block is whole again, in its original order.
PR 1 follow-up: Fluent override modules (old → new map)Rules moved verbatim (same selectors and declarations), re-wrapped in their original scope
Rule file: the module of the Web Chat local name closest to the rule's subject. Commits (on top of baed602):
Tests (stack 3,
Cascade check ( Tools: |
…s the output CSS A second rule in the lightning-css vibe-grep preset, which component, bundle and fluent-theme already run on their output CSS after the build.
… on their class maps The class map of a CSS module also goes through this onLoad. It has no --webchat-preserve-reason today, but would with dashed ident renaming, and Lightning CSS cannot parse JavaScript.
Replaces the 26 override modules, one per Web Chat CSS module, with fluentCSSModuleTheme.module.css, which keeps the rules in their original order and regions, scoped by :global(.webchat-fluent) as before. Fluent's elements now get one class for each scope name (e.g. ".theme") from it, instead of one per override module.
Changelog Entry
None: internal refactoring with no visible change, label
no-changelog.Description
Fluent's CSS modules selected 101 class names of Web Chat CSS modules through
:global(). Fluent's rules for Web Chat elements now live in one override CSS module, whichFluentThemeProviderpasses whole through<CSSModuleThemeComposer>(#5984). Each element gets at most two Fluent classes.Design
fluent-theme/src/private/fluentCSSModuleTheme.module.css: rules moved unchanged from Fluent'sPartGroupingDecorator,SendBoxandThememodules, keeping order, regions and scope, so the cascade does not change--webchat-preserve-reason: target-class;, whichesbuildPlugins.mjsstrips after the class map is built; vibe-grep fails the build if one is leftSpecific Changes
FluentThemeProvider: wraps everything in<CSSModuleThemeComposer>ActivityButton,SendBox: classes for themes, kept by the declaration abovefluentCSSModuleTheme.spec.ts: only the override module uses Web Chat local names, never through:global()package.json:lightningcssdev dependency (1.32.0, as installed today).changelog/<PR#>-<slug>.mdReview Checklist
z-index)package.jsonandpackage-lock.jsonreviewed