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

Shadow Panel: Add reset button #68981

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

Conversation

yogeshbhutkar
Copy link
Contributor

What, Why and How?

Closes #68973

This PR adds a reset button to the Shadow Panel, which becomes visible on hover or focus.

Testing Instructions

  1. Navigate to the post edit page.
  2. Create a Group block and try changing the default shadow.
  3. Observe the presence of the new reset button, which appears on hover.
  4. Try pressing the reset button and confirm the shadow gets reset.

Screencast

shadow-demo.mov

@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review January 31, 2025 11:00
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: yogeshbhutkar <[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.

@shail-mehta shail-mehta added [Type] Enhancement A suggestion for improvement. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Jan 31, 2025
Comment on lines +36 to +38
> .components-button.has-icon.has-text:first-child {
gap: $grid-unit-10;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

CSS selectors with the .components- prefix should be avoided as much as possible. Can we use the HStack component inside the Button component as in the previous implementation?

Comment on lines +47 to +48
transition: opacity 0.1s ease-in-out;
@include reduce-motion("transition");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
transition: opacity 0.1s ease-in-out;
@include reduce-motion("transition");
@media not ( prefers-reduced-motion ) {
transition: opacity 0.1s ease-in-out;
}

See #68282

'block-editor-global-styles__shadow-editor__remove-button',
{ 'is-open': isOpen }
),
label: __( 'Remove shadow' ),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
label: __( 'Remove shadow' ),
label: __( 'Reset' ),

Keep wording consistent with other similar UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shadow Panel: Add reset button
3 participants