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

Social Links: Remove redundant reduce-motion mixin #69000

Conversation

himanshupathak95
Copy link
Contributor

@himanshupathak95 himanshupathak95 commented Feb 3, 2025

Part of / Closes: #68282
Follow up: #68282 (comment)

What?

Removes redundant reduce-motion mixin from social links incomplete state in editor styles.

Why?

In the social links editor styles, we had a reduce-motion mixin applied to the incomplete social link state (wp-social-link__is-incomplete). However, this mixin was unnecessary because:

  • There is no explicit opacity transition defined that needs to be disabled
  • The only animation (transform on hover) is already properly handled with a media query in style.scss
  • The opacity change is instant by default

Testing Instructions

  1. In the editor, add a Social Links block
  2. Click the "+" button to start adding a new social link but don't complete it
  3. Verify the incomplete social link appears semi-transparent (opacity: 0.5)
  4. Test opacity changes - Hover over the incomplete link - it should become fully opaque

Test motion preferences:

  1. Enable "Emulate CSS media feature prefers-reduced-motion: reduce"
  2. Verify the opacity change remains instant

Screencast

Screen.Recording.2025-02-03.at.10.29.07.mov

@himanshupathak95
Copy link
Contributor Author

Hey @t-hamano, Thanks for pointing this issue out.

I see that the mixing @include reduce-motion("transition"); was added in #18750 to respect the user's preferences of motion handling.

I found that the incomplete link state never defined an explicit transition for the opacity property - the opacity change was always instant. The only actual transition in social links (the transform/scale effect on hover) is already properly handled with a media query in style.scss.

The mixin was essentially a no-op since it was setting transition duration/delay to 0s for a transition that didn't exist.
I've tested the transition with the motion enabled and disabled, it seems to be fine. Let me know if it looks good to you.

@himanshupathak95 himanshupathak95 marked this pull request as ready for review February 3, 2025 05:30
Copy link

github-actions bot commented Feb 3, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: himanshupathak95 <[email protected]>
Co-authored-by: mirka <[email protected]>
Co-authored-by: Mayank-Tripathi32 <[email protected]>
Co-authored-by: t-hamano <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

I tested some older versions of WordPress and the opacity animations didn't seem to work at all, so I think it's safe to remove this mixin.

@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Block] Social Affects the Social Block - used to display Social Media accounts labels Feb 3, 2025
@t-hamano t-hamano merged commit 0feca71 into WordPress:trunk Feb 3, 2025
71 of 74 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.3 milestone Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Social Affects the Social Block - used to display Social Media accounts [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

a11y: Respect prefers-reduced-motion for all animations
2 participants