Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-badge): Remove white border around presence badge when on a dark background #27780

Merged
merged 6 commits into from
May 9, 2023

Conversation

behowell
Copy link
Contributor

@behowell behowell commented May 5, 2023

Previous Behavior

The background color of presence badge bleeds around the edge of the icon due to antialiasing on the svg and element background.

image
image

New Behavior

Inset the background using padding: 1px; background-clip: content-box. Add margin: -1px to the icon to offset the padding.

This works because all presence icons have a border around the edge that is at least 1px wide (except size="tiny", where this fix is not applied).

image
image

@behowell behowell self-assigned this May 5, 2023
@github-actions github-actions bot added this to the May Project Cycle Q2 2023 milestone May 5, 2023
@fabricteam
Copy link
Collaborator

fabricteam commented May 5, 2023

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-alert
Alert
93.344 kB
22.431 kB
93.534 kB
22.497 kB
190 B
66 B
react-avatar
Avatar
57.564 kB
14.976 kB
57.754 kB
15.041 kB
190 B
65 B
react-avatar
AvatarGroupItem
73.778 kB
19.491 kB
73.968 kB
19.552 kB
190 B
61 B
react-badge
PresenceBadge
31.904 kB
8.296 kB
32.094 kB
8.367 kB
190 B
71 B
react-persona
Persona
64.485 kB
16.9 kB
64.675 kB
16.968 kB
190 B
68 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-avatar
AvatarGroup
15.632 kB
6.258 kB
react-badge
Badge
23.512 kB
7.197 kB
react-badge
CounterBadge
24.416 kB
7.506 kB
react-components
react-components: Button, FluentProvider & webLightTheme
64.855 kB
17.852 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
203.885 kB
57.081 kB
react-components
react-components: FluentProvider & webLightTheme
36.086 kB
11.9 kB
react-portal-compat
PortalCompatProvider
6.446 kB
2.186 kB
react-table
DataGrid
147.531 kB
40.517 kB
react-table
Table (Primitives only)
44.348 kB
12.347 kB
react-table
Table as DataGrid
130.09 kB
33.08 kB
react-table
Table (Selection only)
78.004 kB
19.079 kB
react-table
Table (Sort only)
77.334 kB
18.891 kB
🤖 This report was generated against c02b44a98770f8d9da499dbacadcf377eb5efb45

@fabricteam
Copy link
Collaborator

fabricteam commented May 5, 2023

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 676 706 5000
Button mount 376 374 5000
Field mount 1276 1281 5000
FluentProvider mount 927 919 5000
FluentProviderWithTheme mount 117 111 10
FluentProviderWithTheme virtual-rerender 99 96 10
FluentProviderWithTheme virtual-rerender-with-unmount 114 109 10
InfoButton mount 20 20 5000
MakeStyles mount 1134 1108 50000
Persona mount 2034 1950 5000
SpinButton mount 1581 1565 5000

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 5, 2023

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.

Latest deployment of this branch, based on commit 00c2c16:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor
Copy link

size-auditor bot commented May 5, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: c02b44a98770f8d9da499dbacadcf377eb5efb45 (build)

@behowell behowell changed the title fix: Remove white border around presence badge when on a dark background fix(react-badge): Remove white border around presence badge when on a dark background May 8, 2023
@behowell behowell marked this pull request as ready for review May 8, 2023 23:31
@behowell behowell requested review from a team as code owners May 8, 2023 23:31
@behowell behowell merged commit b83d941 into microsoft:master May 9, 2023
@behowell behowell deleted the badge/background-bleed branch May 9, 2023 19:47
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request May 10, 2023
* master:
  feat(react-drawer): create DrawerBody component (microsoft#27581)
  feat(react-tree): TreeItem itemType restructure (microsoft#27799)
  feat: Implement state management for toasts (microsoft#27800)
  bugfix: fix VisibleFlatTreeItemGenerator omitting visible items (microsoft#27802)
  fix: overflowManager should always dispatch initial state (microsoft#27756)
  fix(react-badge): Remove white border around presence badge when on a dark background (microsoft#27780)
  react-tags: rename dismissable to dismissible (microsoft#27798)
  chore: update ownership of react-tags (microsoft#27795)
  applying package updates
  feat(react-tags): Replace `avatar` prop with `media`; polish styles for spacing (microsoft#27725)
  RFC appearance migration (microsoft#24181)
  chore(react-skeleton): Release react-skeleton to stable (microsoft#27767)
  fix(Coachmark): Remove positioning regression and update bounds on resize (microsoft#27782)
  applying package updates
  fix(v8): explicitly publish dist folder after node 16 upgrade (microsoft#27769)
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request May 10, 2023
* feat/drawer-header:
  fix: add changefiles
  feat(react-drawer): create DrawerBody component (microsoft#27581)
  feat(react-tree): TreeItem itemType restructure (microsoft#27799)
  feat: Implement state management for toasts (microsoft#27800)
  bugfix: fix VisibleFlatTreeItemGenerator omitting visible items (microsoft#27802)
  fix: overflowManager should always dispatch initial state (microsoft#27756)
  fix(react-badge): Remove white border around presence badge when on a dark background (microsoft#27780)
  react-tags: rename dismissable to dismissible (microsoft#27798)
  chore: update ownership of react-tags (microsoft#27795)
  applying package updates
  feat(react-tags): Replace `avatar` prop with `media`; polish styles for spacing (microsoft#27725)
  RFC appearance migration (microsoft#24181)
  chore(react-skeleton): Release react-skeleton to stable (microsoft#27767)
  fix(Coachmark): Remove positioning regression and update bounds on resize (microsoft#27782)
  applying package updates
  fix(v8): explicitly publish dist folder after node 16 upgrade (microsoft#27769)
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request May 10, 2023
* master: (29 commits)
  feat(react-drawer): create DrawerBody component (microsoft#27581)
  feat(react-tree): TreeItem itemType restructure (microsoft#27799)
  feat: Implement state management for toasts (microsoft#27800)
  bugfix: fix VisibleFlatTreeItemGenerator omitting visible items (microsoft#27802)
  fix: overflowManager should always dispatch initial state (microsoft#27756)
  fix(react-badge): Remove white border around presence badge when on a dark background (microsoft#27780)
  react-tags: rename dismissable to dismissible (microsoft#27798)
  chore: update ownership of react-tags (microsoft#27795)
  applying package updates
  feat(react-tags): Replace `avatar` prop with `media`; polish styles for spacing (microsoft#27725)
  RFC appearance migration (microsoft#24181)
  chore(react-skeleton): Release react-skeleton to stable (microsoft#27767)
  fix(Coachmark): Remove positioning regression and update bounds on resize (microsoft#27782)
  applying package updates
  fix(v8): explicitly publish dist folder after node 16 upgrade (microsoft#27769)
  applying package updates
  fix: do not use outlineStyle: none in createCustomFocusIndicatorStyle (microsoft#26089)
  fix: Scale pulse animation with percentages and flip wave animation's direction (microsoft#27654)
  Publish dist folder that got removed due to node 16 upgrade (microsoft#27764)
  fix(scripts-update-release-notes): properly handle git for-each-ref cmd call to not fail release notes update (microsoft#27757)
  ...
@msft-fluent-ui-bot
Copy link
Collaborator

🎉@fluentui/react-badge@v9.1.11 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants