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

Add type and angle picking to the custom gradient component #19582

Conversation

jorgefilipecosta
Copy link
Member

Description

This PR adds a UI to pick choose between linear and radial gradients and a UI to pick an angle on linear gradients.
The UI is based on some of the designs suggested in #16662.

The changes seem huge but the file custom-gradient-bar.js is purely a rename from index.js with some class name changes plugs a logic to support radial gradient in the bar. I made the rename in a separate commit but GitHub continues to show all the file as new :(
The file index.js is new (while GitHub shows lots of removals from the old file.

How has this been tested?

I verified I can choose between radial and linear gradients.
I verified for linear gradients I can choose an angle for the gradient.

Screenshots

Jan-11-2020 12-28-00

Jan-11-2020 12-25-25

@jorgefilipecosta jorgefilipecosta added [Type] Enhancement A suggestion for improvement. Needs Design Feedback Needs general design feedback. [Package] Components /packages/components [Block] Cover Affects the Cover Block - used to display content laid over a background image [Block] Buttons Affects the Buttons Block labels Jan 11, 2020
@jorgefilipecosta jorgefilipecosta force-pushed the add/grandient-type-and-angle-picking-to-custom-gradient-component branch from 0ce5e5f to e41c723 Compare January 29, 2020 16:14
@jorgefilipecosta
Copy link
Member Author

This PR was rebased and now includes the angle picker by default. It is ready for a review.

@mapk
Copy link
Contributor

mapk commented Feb 6, 2020

I'm excited to get this in! Here's some feedback that might help tighten this up a bit more.

  1. Let’s minimize those tabs (Solid color | Gradient) as much as possible. They’re too big right now.
  2. Change the word "Overlay" to "Color".
  3. Remove the border around the gradient type icons.
  4. Provide more vertical padding between all the parts. (24px or some other CSS variable close to that)
  5. Make sure the Angle number field and the "Clear" button align along the right side nicely.

These changes should look something like this:

Screen Shot 2020-02-06 at 12 03 38 PM

@mapk
Copy link
Contributor

mapk commented Feb 6, 2020

One more minor text change here that could help.

Accordion title = Overlay
Label next to swatch = Color
Tabs = Solid | Gradient

This may help avoid repetition in the text.

@jorgefilipecosta jorgefilipecosta force-pushed the add/grandient-type-and-angle-picking-to-custom-gradient-component branch from e41c723 to a90e781 Compare February 7, 2020 11:54
@jorgefilipecosta jorgefilipecosta force-pushed the add/grandient-type-and-angle-picking-to-custom-gradient-component branch from a90e781 to 8827cd5 Compare February 7, 2020 12:19
Copy link
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

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

Tested and works perfectly. Codewise everything looks good.

@jorgefilipecosta jorgefilipecosta changed the title Add Grandient type and angle picking to custom gradient component Add type and angle picking to the custom gradient component Feb 7, 2020
@jorgefilipecosta jorgefilipecosta merged commit 4c472c3 into master Feb 7, 2020
@jorgefilipecosta jorgefilipecosta deleted the add/grandient-type-and-angle-picking-to-custom-gradient-component branch February 7, 2020 14:48
@jorgefilipecosta jorgefilipecosta removed the Needs Design Feedback Needs general design feedback. label Feb 7, 2020
@github-actions github-actions bot added this to the Gutenberg 7.5 milestone Feb 7, 2020
@ItsJonQ
Copy link

ItsJonQ commented Feb 7, 2020

@mapk Hallo!! I'm helping out @jorgefilipecosta with the design follow ups :)

Will create a separate PR with updates!

@ItsJonQ
Copy link

ItsJonQ commented Feb 7, 2020

@mapk Haii! I had a question 👋

Remove the border around the gradient type icons.

If we do this, then there's no indication of which gradient type is active:

Screen Shot 2020-02-07 at 11 06 13 AM

How would you like to proceed?

@mapk
Copy link
Contributor

mapk commented Feb 7, 2020

How would you like to proceed?

The grey border in that image should be removed. But the grey background on the icon when it's selected should remain. I hope that helps!

@karmatosed
Copy link
Member

karmatosed commented Feb 7, 2020

I wonder if a simple square and either circle in it or arrow would work. I really like what Figma does and riffed on that in the monotone (Figma screenshots in green).

Frame 1

I added on states to these to show.

@mapk
Copy link
Contributor

mapk commented Feb 7, 2020

Oooh! I really like these two:

Screen Shot 2020-02-07 at 9 01 15 AM

Let's go with these. I'd like to see these in relation to our already standard icon selection background indicator (dark grey background). If that doesn't work too well, we can look into the thinner selection idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block [Block] Cover Affects the Cover Block - used to display content laid over a background image [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants