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

CircularOption: Avoid paint on circular option hover #46197

Merged
merged 1 commit into from
Dec 2, 2022
Merged
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
Expand Up @@ -26,6 +26,7 @@ $color-palette-circle-spacing: 12px;
vertical-align: top;
transform: scale(1);
transition: 100ms transform ease;
will-change: transform;
Copy link
Member

Choose a reason for hiding this comment

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

All sources of documentation (for example https://developer.mozilla.org/en-US/docs/Web/CSS/will-change#via_script and ) I read about will-change suggest that we add it programmatically and remove it after it's served its purpose, rather than having it enabled by default.

Have you considered adding it as a one-off effect in this component and then removing it on cleanup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tyxla You're thinking of adding it when the popover opens ? We can use a translateZ(0) instead of will-change to get the same result !

Copy link
Contributor

Choose a reason for hiding this comment

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

Have we tested adding it only on hover/focus ? Or what about using the contain CSS property instead?

Copy link
Member

Choose a reason for hiding this comment

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

I think adding it on :hover/:focus can be too late since the browser won't be able to do the optimizations before performing the actual element transformation.

@include reduce-motion("transition");

&:hover {
Expand Down