diff --git a/.changelog/5935-fix-fluent-forced-suggested-action.md b/.changelog/5935-fix-fluent-forced-suggested-action.md new file mode 100644 index 0000000000..4bb24e4719 --- /dev/null +++ b/.changelog/5935-fix-fluent-forced-suggested-action.md @@ -0,0 +1,3 @@ +### Fixed + +- Fixed Fluent suggested actions showing the page background through them in forced colors, in PR [#5935](https://github.com/microsoft/BotFramework-WebChat/pull/5935), by [@OEvgeny](https://github.com/OEvgeny) diff --git a/__tests__/html2/fluentTheme/suggestedActions.forcedColors.dark.html b/__tests__/html2/fluentTheme/suggestedActions.forcedColors.dark.html new file mode 100644 index 0000000000..e0a7789a0d --- /dev/null +++ b/__tests__/html2/fluentTheme/suggestedActions.forcedColors.dark.html @@ -0,0 +1,9 @@ + + + + + + + diff --git a/__tests__/html2/fluentTheme/suggestedActions.forcedColors.dark.html.snap-1.png b/__tests__/html2/fluentTheme/suggestedActions.forcedColors.dark.html.snap-1.png new file mode 100644 index 0000000000..5595aae1a6 Binary files /dev/null and b/__tests__/html2/fluentTheme/suggestedActions.forcedColors.dark.html.snap-1.png differ diff --git a/__tests__/html2/fluentTheme/suggestedActions.forcedColors.html b/__tests__/html2/fluentTheme/suggestedActions.forcedColors.html new file mode 100644 index 0000000000..5eedfa7c74 --- /dev/null +++ b/__tests__/html2/fluentTheme/suggestedActions.forcedColors.html @@ -0,0 +1,117 @@ + + + + + + + +
+ + + + diff --git a/__tests__/html2/fluentTheme/suggestedActions.forcedColors.html.snap-1.png b/__tests__/html2/fluentTheme/suggestedActions.forcedColors.html.snap-1.png new file mode 100644 index 0000000000..b989bca5c4 Binary files /dev/null and b/__tests__/html2/fluentTheme/suggestedActions.forcedColors.html.snap-1.png differ diff --git a/packages/fluent-theme/src/components/suggestedActions/SuggestedAction.module.css b/packages/fluent-theme/src/components/suggestedActions/SuggestedAction.module.css index 0485ee8002..59e4deab02 100644 --- a/packages/fluent-theme/src/components/suggestedActions/SuggestedAction.module.css +++ b/packages/fluent-theme/src/components/suggestedActions/SuggestedAction.module.css @@ -27,6 +27,14 @@ color: var(--webchat-colorNeutralForegroundDisabled); cursor: not-allowed; } + + /* Forced colors keep a transparent background transparent, so the host page would show through the button. */ + @media (forced-colors: active) { + &, + &:not([aria-disabled='true']):is(:active, :hover) { + background-color: ButtonFace; + } + } } :global(.webchat-fluent) .suggested-action__image {