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

Editor: Standardize reduced motion handling using media queries #68424

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

himanshupathak95
Copy link
Contributor

@himanshupathak95 himanshupathak95 commented Dec 31, 2024

Part of: #68282

What?

Replace all instances of the reduce-motion mixin with standardized @media not (prefers-reduced-motion) media queries across the editor package components to improve code consistency and maintainability.

Testing Instructions

Test Document Bar and Tools:

  • Open the editor
  • Hover over the document bar buttons
  • Click the inserter toggle (+ button)
  • Verify smooth transitions with motion-enabled
  • Verify instant changes with reduced motion enabled

Test Publish Panel:

  • Click the publish/update button
  • Observe the panel slide-in
  • Verify smooth animation with motion-enabled
  • Verify instant appearance with reduced motion enabled

Screencast

Screen.Recording.2025-01-01.at.15.35.12.mov
Screen.Recording.2025-01-01.at.15.36.33.mov
Screen.Recording.2025-01-01.at.15.38.17.mov

@himanshupathak95 himanshupathak95 marked this pull request as ready for review January 1, 2025 12:03
Copy link

github-actions bot commented Jan 1, 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: 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.

LGTM!

@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Package] Editor /packages/editor labels Jan 11, 2025
@himanshupathak95
Copy link
Contributor Author

Hi @t-hamano, Thanks for approving the PR.

✅ The storybook builds are successful

I will remove this in a follow-up PR which I am going to raise for this

This PR is ready to be merged now 🚀

@t-hamano
Copy link
Contributor

@himanshupathak95 Thanks for the update!

I will remove this in a follow-up PR which I am going to raise for this

Is there any reason not to address this in this PR? If we don't remove this code in this PR, we will end up with redundant code like this:

.editor-post-featured-image__actions {
	&:not(.editor-post-featured-image__actions-missing-image) {
		@include reduce-motion("transition");

		@media not (prefers-reduced-motion) {
			transition: opacity 50ms ease-out;
		}
	}
}

@himanshupathak95
Copy link
Contributor Author

@t-hamano, Thanks for the suggestion. I have removed the redundant mixin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Editor /packages/editor [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants