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 proper padding to ColorGradientControl #37502

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.block-editor-color-gradient-control {
padding: $grid-unit-10;

Comment on lines +2 to +3
Copy link
Member

Choose a reason for hiding this comment

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

Since this component can be used in other (e.g. not in a popover) contexts as well, I think it would be better not to give it inherent padding, and instead make the consumer component responsible for adding whatever padding is desired.

For example, we could add a padding wrapper div here:

<ColorGradientControl
showTitle={ false }
{ ...{
colors,
gradients,
disableCustomColors,
disableCustomGradients,
__experimentalHasMultipleOrigins,
__experimentalIsRenderedInSidebar,
enableAlpha,
...setting,
} }
/>

This way we only affect our specific dropdown use case.

.block-editor-color-gradient-control__color-indicator {
margin-bottom: $grid-unit-15;
}
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/color-palette/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
background: none;
display: block;
border-radius: $radius-block-ui;
padding: 0 $grid-unit-10;
height: $grid-unit-60;
text-align: right;
width: 100%;
Expand Down