Skip to content

Commit 97087c9

Browse files
authored
[fix] focus-visible state for primary selected focus state for toggle button and primary hover button (#34400)
1 parent e20d2db commit 97087c9

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "fix the selected primary focus state",
4+
"packageName": "@fluentui/web-components",
5+
"email": "jes@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,11 @@ export const baseButtonStyles = css`
197197
background-color: ${colorBrandBackgroundHover};
198198
}
199199
200-
:host([appearance='primary']:is(:hover, :hover:active)) {
200+
:host([appearance='primary']:is(:hover, :hover:active):not(:focus-visible)) {
201201
border-color: transparent;
202+
}
203+
204+
:host([appearance='primary']:is(:hover, :hover:active)) {
202205
color: ${colorNeutralForegroundOnBrand};
203206
}
204207

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ export const styles = css`
5656
background-color: ${colorNeutralBackground1Pressed};
5757
}
5858
59-
:host(${pressedState}[appearance='primary']) {
59+
:host(${pressedState}[appearance='primary']:not(:focus-visible)) {
6060
border-color: transparent;
61+
}
62+
63+
:host(${pressedState}[appearance='primary']) {
6164
background-color: ${colorBrandBackgroundSelected};
6265
color: ${colorNeutralForegroundOnBrand};
6366
}

0 commit comments

Comments
 (0)