-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 gradient RGBA/HSLA inputs' width #24214
Conversation
@@ -178,7 +178,7 @@ export class Inputs extends Component { | |||
return ( | |||
<fieldset> | |||
<VisuallyHidden as="legend"> | |||
{ __( 'Color value in RGB' ) } | |||
{ __( 'Color value in RGBA' ) } |
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.
Do you think this should stay "RGB" unless disableAlpha
is false?
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.
You're right. I missed that. Thanks!
@@ -231,7 +231,7 @@ export class Inputs extends Component { | |||
return ( | |||
<fieldset> | |||
<VisuallyHidden as="legend"> | |||
{ __( 'Color value in HSL' ) } | |||
{ __( 'Color value in HSLA' ) } |
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.
Same here
Size Change: +198 B (0%) Total Size: 1.16 MB
ℹ️ View Unchanged
|
@@ -227,6 +227,11 @@ | |||
padding-top: 16px; | |||
display: flex; | |||
align-items: flex-end; | |||
min-width: 22em; |
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.
Why do we use "em"s here? It seems like we prefer pixels in general in Gutenberg?
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.
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 wonder if a better fix is to wrap inputs (return to the line)
What do you mean by that?
It seems like we prefer pixels in general in Gutenberg
Okay, I'll use pixels.
Issue on mobile
Is this the min width we should make sure it's shown properly? $break-mobile: 480px;
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've made the changes to be visible in mobile too with the minimum min-width
required.
I wonder if a better fix is to wrap inputs (return to the line) when they reach a certain size instead of increasing the popover size.
@youknowriad just let me know what did you mean, so I can maybe explore a different approach.
If you meant though to listen to input changes and change layout or resize, I believe it would cause an unpleasant/confusing user experience.
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 this is a good fix for the moment.
I was thinking maybe if the width is not enough to show 4 inputs, move one to the row (flex-wrap) but it could be explored later.
* fix gradient rgba/hsla inputs width * fix label by disableAlpha value * change to px values * css changes
Description
Fixes: #24201
When adding a gradient with RGBA or HSLA color values to a block, the increment buttons of number inputs cover up the inputs' values.
Steps to reproduce and screenshots in the issue.