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

Data Views: Standardize reduced motion handling using media queries #68422

Merged
merged 3 commits into from
Jan 13, 2025

Conversation

Infinite-Null
Copy link
Contributor

@Infinite-Null Infinite-Null commented Dec 31, 2024

Part of: #68282

What?

Refactors animation and transition styles to use media not (prefers-reduced-motion) for improved accessibility, ensuring a better experience for users who prefer reduced motion.

Why?

It addresses instances where animations and transitions were not optimized for Data Views for individuals with reduced motion settings, ensuring a smoother and more inclusive user experience.

How?

This PR updates the outdated reduce-motion mixin implementation and resolves previously missed instances by adopting the new approach defined in the parent issue.

@media not (prefers-reduced-motion) {
	transition: padding ease-out 0.1s;
}

Screencast

2024-12-31_12-24-22.mp4

@Infinite-Null Infinite-Null marked this pull request as ready for review December 31, 2024 07:08
Copy link

github-actions bot commented Dec 31, 2024

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: Infinite-Null <[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.

@Infinite-Null
Copy link
Contributor Author

Infinite-Null commented Dec 31, 2024

Hi @t-hamano,

I have implemented reduced motion handling using media queries for the data view. Please look at it at your convenience.

Thank you!

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!

Could you rebase this PR to make sure it passes #68466?

Comment on lines 5 to 10
transition: padding ease-out 0.1s;
container-type: inline-size;
@include reduce-motion("transition");

@media not (prefers-reduced-motion) {
transition: padding ease-out 0.1s;
}

container-type: inline-size;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Can you format it like this:

.dataviews-view-grid {
	margin-bottom: auto;
	grid-template-rows: max-content;
	padding: 0 $grid-unit-60 $grid-unit-30;
	container-type: inline-size;

	@media not (prefers-reduced-motion) {
		transition: padding ease-out 0.1s;
	}

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

Hi @t-hamano,

I have made the requested changes and also updated PR branch with the latest changes from trunk. Please have a look at it at your convenience.

Thank You!

@t-hamano t-hamano merged commit d3758ce into WordPress:trunk Jan 13, 2025
63 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.1 milestone Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] DataViews /packages/dataviews [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