Skip to content

Conversation

@robertpenner
Copy link
Collaborator

This pull request addresses a visual bug in the @fluentui/react-button package where toggling the outline appearance on a ToggleButton would cause the button size to increase. The fix ensures the outline effect does not affect the button's layout by using an inset box-shadow instead of a thicker border. Additionally, styles are refactored to ensure consistent transitions and appearance handling.

Bug fix and styling improvements:

  • Changed the outline appearance for checked ToggleButtons to use an inset box-shadow instead of increasing the border width, preventing layout shifts when toggling the button.
  • Added a new useRootAppearanceStyles hook to manage appearance-related base styles, including smooth transitions for box-shadow and other properties.

@robertpenner robertpenner self-assigned this Jan 26, 2026
@robertpenner robertpenner changed the title Fix/toggle button outline shadow fix(toggle-button): prevent outline toggle from increasing button size Jan 26, 2026
@github-actions
Copy link

github-actions bot commented Jan 26, 2026

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-button
ToggleButton
55.154 kB
12.482 kB
55.522 kB
12.501 kB
368 B
19 B
react-components
react-components: entire library
1.291 MB
323.024 kB
1.292 MB
323.128 kB
368 B
104 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-breadcrumb
@fluentui/react-breadcrumb - package
115.758 kB
31.742 kB
react-button
Button
38.231 kB
10.651 kB
react-button
CompoundButton
45.12 kB
11.965 kB
react-button
MenuButton
43.183 kB
12.08 kB
react-button
SplitButton
52.236 kB
13.714 kB
react-card
Card - All
106.017 kB
29.756 kB
react-card
Card
98.685 kB
27.88 kB
react-card
CardFooter
13.642 kB
5.438 kB
react-card
CardHeader
16.175 kB
6.303 kB
react-card
CardPreview
13.726 kB
5.574 kB
react-charts
AreaChart
407.113 kB
124.705 kB
react-charts
DeclarativeChart
756.947 kB
217.86 kB
react-charts
DonutChart
317.554 kB
94.682 kB
react-charts
FunnelChart
309.107 kB
91.579 kB
react-charts
GanttChart
390.222 kB
118.264 kB
react-charts
GaugeChart
316.985 kB
94.055 kB
react-charts
GroupedVerticalBarChart
398.1 kB
120.879 kB
react-charts
HeatMapChart
392.303 kB
120.013 kB
react-charts
HorizontalBarChart
297.281 kB
86.243 kB
react-charts
HorizontalBarChartWithAxis
63 B
83 B
react-charts
Legends
236.192 kB
69.589 kB
react-charts
LineChart
417.675 kB
126.61 kB
react-charts
PolarChart
346.165 kB
105.681 kB
react-charts
SankeyChart
214.767 kB
65.946 kB
react-charts
ScatterChart
397.502 kB
120.762 kB
react-charts
Sparkline
91.393 kB
28.708 kB
react-charts
VerticalBarChart
434.577 kB
126.369 kB
react-charts
VerticalStackedBarChart
404.014 kB
121.7 kB
react-components
react-components: Button, FluentProvider & webLightTheme
71.11 kB
20.219 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
237.741 kB
68.697 kB
react-components
react-components: FluentProvider & webLightTheme
44.409 kB
14.303 kB
react-dialog
Dialog (including children components)
102.964 kB
30.723 kB
react-message-bar
MessageBar (all components)
24.15 kB
8.907 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-tag-picker
@fluentui/react-tag-picker - package
187.42 kB
56.172 kB
react-teaching-popover
TeachingPopover
102.017 kB
30.539 kB
react-timepicker-compat
TimePicker
109.036 kB
36.023 kB
react-tree
FlatTree
148.521 kB
42.459 kB
react-tree
PersonaFlatTree
150.347 kB
42.844 kB
react-tree
PersonaTree
146.407 kB
41.672 kB
react-tree
Tree
144.587 kB
41.298 kB
🤖 This report was generated against 83f780ca128cfe6c9ea35cc3f3b180e2eae1b60d

@github-actions
Copy link

Pull request demo site: URL

@@ -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.

Use strokeWidthThin for focus shadow to layer correctly over strokeWidthThick border shadow when checked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant