Skip to content

Commit

Permalink
[web-components] fix missing focus styles for button and anchor due t…
Browse files Browse the repository at this point in the history
…o whitespace issue (#17515)

* remove whitespace causing focus issue on button and anchor controls

* Change files
  • Loading branch information
chrisdholt authored Mar 22, 2021
1 parent 72f18e0 commit 869c2e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "remove whitespace causing focus issue on button and anchor controls",
"packageName": "@fluentui/web-components",
"email": "chhol@microsoft.com",
"dependentChangeType": "patch"
}
9 changes: 6 additions & 3 deletions packages/web-components/src/styles/patterns/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const BaseButtonStyles: ElementStyles = css`
background-color: ${neutralFillActiveBehavior.var};
}
.control: ${focusVisible} {
.control:${focusVisible} {
border: calc(var(--outline-width) * 1px) solid ${neutralFocusBehavior.var};
box-shadow: 0 0 0 calc((var(--focus-outline-width) - var(--outline-width)) * 1px) ${neutralFocusBehavior.var};
}
Expand All @@ -102,8 +102,10 @@ export const BaseButtonStyles: ElementStyles = css`
}
::slotted(svg) {
${/* Glyph size and margin-left is temporary -
replace when adaptive typography is figured out */ ''} width: 16px;
${
/* Glyph size and margin-left is temporary -
replace when adaptive typography is figured out */ ''
} width: 16px;
height: 16px;
}
Expand All @@ -116,6 +118,7 @@ export const BaseButtonStyles: ElementStyles = css`
}
`.withBehaviors(
neutralFillRestBehavior,
neutralFocusBehavior,
neutralForegroundRestBehavior,
neutralFillHoverBehavior,
neutralFillActiveBehavior,
Expand Down

0 comments on commit 869c2e5

Please sign in to comment.