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

Nux: Standardize reduced motion handling using media queries #68423

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

im3dabasia
Copy link
Contributor

@im3dabasia im3dabasia 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;
}

Screenshots or screencast

@im3dabasia
Copy link
Contributor Author

Closing this as the component is deprecated

@t-hamano
Copy link
Contributor

@im3dabasia While this component is indeed deprecated, it would be good to have more consistency in styling across the Gutenberg project. Feel free to reopen this PR.

@im3dabasia im3dabasia reopened this Jan 13, 2025
@Mamaduka Mamaduka added [Type] Task Issues or PRs that have been broken down into an individual action to take [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). labels Jan 13, 2025
@im3dabasia im3dabasia marked this pull request as ready for review January 14, 2025 05:15
Copy link

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: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

@im3dabasia
Copy link
Contributor Author

im3dabasia commented Jan 14, 2025

Hi @t-hamano,

I explored the NUX package and specifically tried locating where the DotTip component is used in the editor, but I couldn’t find its implementation.

Could you kindly guide me on where it is used so I can record a screencast?

Thank you

DotTip Search image image

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 explored the NUX package and specifically tried locating where the DotTip component is used in the editor, but I couldn’t find its implementation.

That's right. To actually see the DotTip component, we'll need to add your own code.

For example, update the Edit component of any block to the following:

import { useBlockProps } from '@wordpress/block-editor';
import { DotTip } from '@wordpress/nux';

export default function CodeEdit() {
	const blockProps = useBlockProps();
	return (
		<div { ...blockProps }>
			<DotTip tipId="test-1">
				Click here to add the product to your shopping cart.
			</DotTip>
		</div>
	);
}

Then in your browser console run the following (If you hide the DotTip):

wp.data.dispatch( 'core/nux' ).enableTips()

Then you should see the following UI:

image

packages/nux/src/components/dot-tip/style.scss Outdated Show resolved Hide resolved
@im3dabasia im3dabasia requested a review from t-hamano January 15, 2025 07:32
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 merged commit 6940e88 into WordPress:trunk Jan 15, 2025
64 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.1 milestone Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants