Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
Copy link

@github-actions github-actions bot Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/Charts-DonutChart 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Charts-DonutChart.Dynamic - Dark Mode.default.chromium.png 7530 Changed
vr-tests-react-components/Charts-DonutChart.Dynamic.default.chromium.png 5581 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.chromium.png 39 Changed
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 512 Changed
vr-tests-react-components/TagPicker 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled - High Contrast.disabled input hover.chromium.png 1319 Changed
vr-tests-react-components/TagPicker.disabled - Dark Mode.disabled input hover.chromium.png 658 Changed

There were 2 duplicate changes discarded. Check the build logs for more information.

"type": "patch",
"comment": "fix(toggle-button): prevent outline toggle from increasing button size",
"packageName": "@fluentui/react-button",
"email": "robertpenner@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ export const toggleButtonClassNames: SlotClassNames<ButtonSlots> = {
icon: 'fui-ToggleButton__icon',
};

const useRootAppearanceStyles = makeStyles({
// Appearance variations that apply regardless of checked state
outline: {
// Ensure box-shadow transitions in both directions (checked <-> unchecked)
transitionProperty: 'background, border, color, box-shadow',
},
});

const useRootCheckedStyles = makeStyles({
// Base styles
base: {
Expand Down Expand Up @@ -74,18 +82,23 @@ const useRootCheckedStyles = makeStyles({
outline: {
backgroundColor: tokens.colorTransparentBackgroundSelected,
...shorthands.borderColor(tokens.colorNeutralStroke1),
...shorthands.borderWidth(tokens.strokeWidthThicker),
// Use inset box-shadow to create thicker border visual without affecting layout
boxShadow: `0 0 0 ${tokens.strokeWidthThick} ${tokens.colorNeutralStroke1} inset`,

':hover': {
backgroundColor: tokens.colorTransparentBackgroundHover,
boxShadow: `0 0 0 ${tokens.strokeWidthThick} ${tokens.colorNeutralStroke1Hover} inset`,
},

':hover:active,:active:focus-visible': {
backgroundColor: tokens.colorTransparentBackgroundPressed,
boxShadow: `0 0 0 ${tokens.strokeWidthThick} ${tokens.colorNeutralStroke1Pressed} inset`,
},

...createCustomFocusIndicatorStyle({
...shorthands.borderColor(tokens.colorNeutralStroke1),
...shorthands.borderColor(tokens.colorStrokeFocus2),
// Stack focus indicator (strokeWidthThin) on top of the grey border (strokeWidthThick)
boxShadow: `0 0 0 ${tokens.strokeWidthThin} ${tokens.colorStrokeFocus2} inset, 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorNeutralStroke1} inset`,
}),
},
primary: {
Expand Down Expand Up @@ -252,6 +265,7 @@ const usePrimaryHighContrastStyles = makeStyles({
export const useToggleButtonStyles_unstable = (state: ToggleButtonState): ToggleButtonState => {
'use no memo';

const rootAppearanceStyles = useRootAppearanceStyles();
const rootCheckedStyles = useRootCheckedStyles();
const rootDisabledStyles = useRootDisabledStyles();
const iconCheckedStyles = useIconCheckedStyles();
Expand All @@ -262,6 +276,9 @@ export const useToggleButtonStyles_unstable = (state: ToggleButtonState): Toggle
state.root.className = mergeClasses(
toggleButtonClassNames.root,

// Appearance base styles (applies to both checked and unchecked)
appearance === 'outline' && rootAppearanceStyles.outline,

// Primary high contrast styles
appearance === 'primary' && primaryHighContrastStyles.base,
appearance === 'primary' && (disabled || disabledFocusable) && primaryHighContrastStyles.disabled,
Expand Down