Skip to content

Commit

Permalink
fix(web-components): update switch to use margin for checked state to…
Browse files Browse the repository at this point in the history
… support RTL (microsoft#29505)

* use margin for switch checked transition to support RTL

* change files
  • Loading branch information
chrisdholt authored and radium-v committed Apr 29, 2024
1 parent 70badc3 commit d193610
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "fix: update switch to use margin instead of transform for the checked state to support RTL",
"packageName": "@fluentui/web-components",
"email": "chhol@microsoft.com",
"dependentChangeType": "patch"
}
5 changes: 3 additions & 2 deletions packages/web-components/src/switch/switch.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,15 @@ export const styles = css`
height: 14px;
width: 14px;
border-radius: 50%;
margin-inline-start: 0;
background-color: ${colorNeutralForeground3};
transition-duration: ${durationNormal};
transition-timing-function: ${curveEasyEase};
transition-property: transform;
transition-property: margin-inline-start;
}
:host([aria-checked='true']) .checked-indicator {
background-color: ${colorNeutralForegroundInverted};
transform: translateX(20px);
margin-inline-start: calc(100% - 14px);
}
:host([aria-checked='true']:hover) .checked-indicator {
background: ${colorNeutralForegroundInvertedHover};
Expand Down

0 comments on commit d193610

Please sign in to comment.