-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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: Make border around Avatar's badge transparent using a mask #27527
Conversation
📊 Bundle size reportUnchanged fixtures
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 999a7998e3913ab823fe24069f0b5d1aab2b2ce0 (build) |
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 714 | 720 | 5000 | |
Button | mount | 373 | 376 | 5000 | |
Field | mount | 1292 | 1273 | 5000 | |
FluentProvider | mount | 917 | 915 | 5000 | |
FluentProviderWithTheme | mount | 117 | 114 | 10 | |
FluentProviderWithTheme | virtual-rerender | 101 | 101 | 10 | |
FluentProviderWithTheme | virtual-rerender-with-unmount | 112 | 108 | 10 | |
InfoButton | mount | 20 | 22 | 5000 | |
MakeStyles | mount | 1121 | 1128 | 50000 | |
Persona | mount | 2043 | 1962 | 5000 | |
SpinButton | mount | 1616 | 1604 | 5000 |
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 d501da0:
|
f784832
to
3ccfcf9
Compare
…splayed while the image is loading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the minor comment, lgtm
* master: applying package updates microsoft#25730: TimePicker Default Value Fix, Controllable Usage, Example Updates (microsoft#26482) docs(react-datepicker-compat): Add description to README.md (microsoft#27677) Updated to use single hook selector (microsoft#27491) fix: Make border around Avatar's badge transparent using a mask (microsoft#27527) Disable focus on non-interactive elements (microsoft#27580) feat(react-drawer): implement "prevent close on click outside" feature (microsoft#27551)
* master: applying package updates microsoft#25730: TimePicker Default Value Fix, Controllable Usage, Example Updates (microsoft#26482) docs(react-datepicker-compat): Add description to README.md (microsoft#27677) Updated to use single hook selector (microsoft#27491) fix: Make border around Avatar's badge transparent using a mask (microsoft#27527) Disable focus on non-interactive elements (microsoft#27580) feat(react-drawer): implement "prevent close on click outside" feature (microsoft#27551)
* feat/drawer-components: (81 commits) docs: remove TODO marks fix: remove conflict code leftover applying package updates microsoft#25730: TimePicker Default Value Fix, Controllable Usage, Example Updates (microsoft#26482) docs(react-datepicker-compat): Add description to README.md (microsoft#27677) Updated to use single hook selector (microsoft#27491) fix: Make border around Avatar's badge transparent using a mask (microsoft#27527) Disable focus on non-interactive elements (microsoft#27580) feat(react-drawer): implement "prevent close on click outside" feature (microsoft#27551) fix(react-datepicker-compat): Make onValidationError onValidationResult so the error is updated when there's no longer an error (microsoft#27655) Fix `@fluentui/react-portal-compat`: to be compatible with React 18 (microsoft#27577) chore: fix versions of @fluentui/react-datepicker-compat (microsoft#27666) applying package updates applying package updates Make line chart screen reader accessible (microsoft#27632) fix(react-examples): Improve keyboard navigation in ContextualMenu.CustomMenuList (microsoft#25172) docs(react-textarea): Update examples to use Field (microsoft#27644) bugfix(react-dialog): `DialogTitle` root as `h2` by default (microsoft#27555) applying package updates chore: restructure stories, add separate category for flat tree (microsoft#27586) ...
🎉 Handy links: |
Previous Behavior
The gap between the Avatar and its badge is a solid color border, which matches the default background color. This results in a visible border around the badge when it is placed on another color background.
New Behavior
mask-image: radial-gradient(...)
to punch out a circle for the badge.::after
element, and leave the active ring on the::before
element.mask-image
property clips everything outside of the element'sborder-box
, which prevents the shadow from rendering whenactiveDisplay="shadow"
since shadows render outside of the border ox.. To fix this, need to put the ring and shadow on separate elements, and only apply the mask to the ring.radial-gradient
definition with slightly different parameters.::before
and::after
elements into the root resetStyles. This reduces bundle size and improves perf when theactive
prop is used. This is not strictly related to this change, but it is enabled by the newringWidth
variable, and offsets the bundle size increases from the rest of this PR.Related Issue(s)