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

Custom Gradient Picker: Add border to improve visibility of light gradients #69239

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

dhruvikpatel18
Copy link
Contributor

@dhruvikpatel18 dhruvikpatel18 commented Feb 19, 2025

Closes #50507

What?

Adds a visible border and subtle box shadow to the gradient picker bar to improve visibility when using white or light-colored gradients.

Why?

Currently, when the gradient is white or very light in color, the field in the color palette panel is hard to see, making it difficult for users to interact with the gradient controls. This creates a poor user experience when working with light colors.

How?

  • Added a default border using WordPress admin theme color
  • Implemented a dynamic border that becomes more prominent for light gradients
  • Added subtle box shadow for better definition
  • Maintained existing checkerboard pattern for transparency
  • Added utility function to detect light gradients
  • Added appropriate className conditionals

Testing Instructions

  1. Open the block editor
  2. Add any block that supports gradients (like a Cover block)
  3. Open the gradient picker
  4. Create a gradient using white or very light colors
  5. Verify that the gradient bar is clearly visible with a border
  6. Create another gradient with dark colors
  7. Verify that the border is appropriately subtle for dark gradients
  8. Test different gradient combinations to ensure the border visibility is appropriate

Screenshots or screencast

Before

Screen.Recording.2025-02-19.at.12.34.24.PM.mov

After

Screen.Recording.2025-02-19.at.12.35.29.PM.mov

@dhruvikpatel18 dhruvikpatel18 marked this pull request as ready for review February 19, 2025 11:24
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: dhruvikpatel18 <[email protected]>
Co-authored-by: hanneslsm <[email protected]>

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

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Feature] Colors Color management [Package] Components /packages/components labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Colors Color management [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gradient: Add a border
2 participants