microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
17.75k stars 2.65k forks source link

Add HC styling for Switch when using font icons #31241

Closed tomi-msft closed 2 weeks ago

tomi-msft commented 2 weeks ago

This PR fixes a visual issue with the Switch component in HC mode when the icon rendered is a font icon. The <i> tag has a black backplate in HC mode that doesn't get overridden by the color of its parent.

Fixes #31192

fabricteam commented 2 weeks ago

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
FluentProviderWithTheme virtual-rerender 34 41 10 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 602 627 5000
Button mount 315 306 5000
Field mount 1098 1129 5000
FluentProvider mount 720 693 5000
FluentProviderWithTheme mount 83 83 10
FluentProviderWithTheme virtual-rerender 34 41 10 Possible regression
FluentProviderWithTheme virtual-rerender-with-unmount 76 75 10
MakeStyles mount 845 862 50000
Persona mount 1765 1723 5000
SpinButton mount 1357 1358 5000
SwatchPicker mount 1534 1552 5000

codesandbox-ci[bot] commented 2 weeks ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

fabricteam commented 2 weeks ago

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.098 MB
266.601 kB
1.098 MB
266.626 kB
148 B
25 B
react-switch
Switch
35.14 kB
11.199 kB
35.288 kB
11.226 kB
148 B
27 B
Unchanged fixtures | Package & Exports | Size (minified/GZIP) | | ----------------- | -------------------: | | react-components
react-components: Button, FluentProvider & webLightTheme | `71.104 kB`
`20.52 kB` | | react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover | `221.203 kB`
`62.464 kB` | | react-components
react-components: FluentProvider & webLightTheme | `43.591 kB`
`14.356 kB` | | react-portal-compat
PortalCompatProvider | `7.944 kB`
`2.588 kB` |

🤖 This report was generated against 05aa0d7e44ec602ca2a6a3a5303603d39d6844bb

fabricteam commented 2 weeks ago

🕵 fluentuiv9 No visual regressions between this PR and main

behowell commented 2 weeks ago

When checking the PR demo site, I noticed that the switch disappears on mouse down. But that bug also repros before this change, so I logged a separate issue about it: