Skip to content

Commit 60d6046

Browse files
authored
fix: compound-button text colors in Windows high contrast mode (microsoft#34490)
1 parent 0b16de1 commit 60d6046

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Fixed compound-button high contrast text colors.",
4+
"packageName": "@fluentui/web-components",
5+
"email": "601470+mlijanto@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/web-components/src/compound-button/compound-button.styles.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
spacingHorizontalSNudge,
1919
spacingHorizontalXS,
2020
} from '../theme/design-tokens.js';
21+
import { forcedColorsStylesheetBehavior } from '../utils/index';
2122

2223
// Need to support icon hover styles
2324
export const styles = css`
@@ -117,4 +118,11 @@ export const styles = css`
117118
:host([size='large']) ::slotted([slot='description']) {
118119
font-size: ${fontSizeBase300};
119120
}
120-
`;
121+
`.withBehaviors(
122+
forcedColorsStylesheetBehavior(css`
123+
:host([appearance='primary']:not(:hover, :focus-visible, :disabled, [disabled-focusable]))
124+
::slotted([slot='description']) {
125+
color: HighlightText;
126+
}
127+
`),
128+
);

0 commit comments

Comments
 (0)