-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Tweak color pickers to use outlines and reduce spacing #61369
Conversation
Not 100% on this, but wanted to feel it out. |
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -46 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR also appears to be intended to reduce the palette space of the Duotone control, but the spacing between the palettes does not seem to be consistent.
I'm guessing one reason for this is that DuotoneControl
has a hard-coded popover width. How about deriving the popover width from the popover padding, the size of the swatches, the spacing between swatches, and the number of swatches you want to display in a row, like the popover width for the ColorGradients
component?
width: ( $swatch-size * 6 ) + ( $swatch-gap * 5 ) + ( $panelPadding * 2 ); | ||
width: ( $swatch-size * 5 ) + ( $swatch-gap * 6 ) + ( $panelPadding * 2 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this logic creates spacing on the right side of the palette.
If we expect 6 palettes in a row as before, we should change this value from 12px to 8px:
$swatch-gap: 12px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using outlines looks good and don't mind reducing the spacing, although I share the concerns @t-hamano had. As long as the spacing is consistent everywhere, we should be good. I did like the scaling effect more than just having an outline, though. Does it make sense to both scale and use outlines?
I also wonder if it makes sense to take it one step at a time? Working around spacing in one PR, and then work on the outlines vs scaling in another one, since this PR is doing a few things at the same time.
transition: 100ms transform ease; | ||
will-change: transform; | ||
@include reduce-motion("transition"); | ||
|
||
&:hover { | ||
transform: scale(1.2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of liked the scaling though, and could live with the slightly blurred icon.
If the blurred scaling svg is a real problem, perhaps we can use a unicode check instead? Should be quite straightforward to change from svg
to a <span>✓</span>
- we'll only need to add some styles, like width
and height
to it, and change the selectedIconProps
to provide style: { color }
instead of fill
.
6ad9367
to
ebcabef
Compare
Flaky tests detected in ebcabef. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9181282451
|
Closing as inactive/outdated. |
What?
Trying tiny optimizations for color palette items.
Testing Instructions
Screenshots or screencast