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

Fix design of color/gradient controls in editor panel #26255

Merged
merged 5 commits into from
Oct 20, 2020

Conversation

stokesman
Copy link
Contributor

@stokesman stokesman commented Oct 19, 2020

#23802 had a lot of good improvements and this follows up on that addressing three issues.

  1. Since it was merged the default position of labels in SelectControl changed SelectControl: Fix labelPosition #25427, throwing the alignment off in CustomGradienPicker.

  2. The change to make the swatches align on the right side with their neighboring controls CustomGradientPicker: Update Type and Angle controls #23802 (comment) currently only works when there is no scrollbar on the settings sidebar and can be improved to work with or without scrollbars.

  3. The "dial" of the AnglePickerControl was able to push out of alignment (to the right) when the settings sidebar has a scrollbar.

All of the above can be noted in the "before" screen capture below.

Before After
color-gradient-panel-before color-gradient-panel-after
After screen recording comparing settings sidebar with and without overflow
Before screen recording comparing settings sidebar with and without overflow

An aside is the AnglePickerControl gets a default label which according to its readme it already had.

How has this been tested?

Wordpress 5.5.1, Chrome 85
Resolutions from 280 to 1440.

Types of changes

Non-breaking design fixes
Accessibility fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@stokesman stokesman changed the title Fix: color/gradient editor panel related design Fix design of color/gradient controls in editor panel Oct 19, 2020
- switch label position to side on control for gradient type
- use flex blocks to wrap type and angle controls
for CircularOptionPicker
- restore default horizontal spacing as equal to vertical
- improve accuracy of negative margin swatch wrapping correction
- drop a purposeless rule
for PanelColorGradientSettingsInner
- create media query bound optimization for six swatches per line
@stokesman stokesman force-pushed the fix/color-gradient-panel-design branch from c2d2a6d to f23a398 Compare October 19, 2020 15:09
@stokesman stokesman marked this pull request as ready for review October 19, 2020 15:55
@stokesman
Copy link
Contributor Author

CC @jasmussen and @ItsJonQ because of their work in #23802

@jasmussen jasmussen self-requested a review October 19, 2020 16:44
Copy link
Contributor

@jasmussen jasmussen left a comment

Choose a reason for hiding this comment

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

This is a good one.

Before:

Screenshot 2020-10-19 at 18 37 52

After:

Screenshot 2020-10-19 at 18 40 26

I was worried that the "Type" label would be vastly longer in german or other languages, though it appears that particular phrase hasn't yet been widely translated. So I manually found the longest version of "Type" that I could on Google Translate, and even in (what I hope is) Malay it works:

Screenshot 2020-10-19 at 18 44 13

Well done. And thank you.

I would love for this to get a few more code-review eyes before merge, but from what I can tell, this is solid, including the code. Nice little win.

@ItsJonQ ItsJonQ self-requested a review October 20, 2020 16:47
Copy link

@ItsJonQ ItsJonQ left a comment

Choose a reason for hiding this comment

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

🚀 from me! Great use of the Flex components @stokesman . That 5/4 combo is an interesting one! :)

@ItsJonQ ItsJonQ merged commit f29dd2a into WordPress:master Oct 20, 2020
@github-actions github-actions bot added this to the Gutenberg 9.3 milestone Oct 20, 2020
@stokesman
Copy link
Contributor Author

Thanks for reviewing Joen and Jon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants