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

Background image: move controls into a popover #60151

Merged
merged 11 commits into from
Jul 3, 2024
Prev Previous commit
Revert input sizes
Ensure long file names are not cut off by min-width
Use clamp value for focal picker image height
  • Loading branch information
ramonjd committed Jul 3, 2024
commit 34d20ce2ddb44385f2633b4d1df4934c9b5ab194
Original file line number Diff line number Diff line change
Expand Up @@ -545,13 +545,15 @@ function BackgroundSizeControls( {
return (
<VStack spacing={ 3 } className="single-column">
<FocalPointPicker
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Position' ) }
url={ getResolvedThemeFilePath( imageValue, themeFileURIs ) }
value={ backgroundPositionToCoords( positionValue ) }
onChange={ updateBackgroundPosition }
/>
<ToggleGroupControl
size="__unstable-large"
label={ __( 'Size' ) }
value={ currentValueForToggle }
onChange={ updateBackgroundSize }
Expand Down Expand Up @@ -590,6 +592,7 @@ function BackgroundSizeControls( {
aria-label={ __( 'Background image width' ) }
onChange={ updateBackgroundSize }
value={ sizeValue }
size="__unstable-large"
__unstableInputWidth="100px"
min={ 0 }
placeholder={ __( 'Auto' ) }
Expand Down
11 changes: 7 additions & 4 deletions packages/block-editor/src/components/global-styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,12 @@
text-align-last: center;
}

.block-editor-global-styles-background-panel__inspector-image-indicator-wrapper {
width: 20px;
height: 20px;
.block-editor-global-styles-background-panel__inspector-preview-inner {
.block-editor-global-styles-background-panel__inspector-image-indicator-wrapper {
width: 20px;
height: 20px;
min-width: auto;
}
}

.block-editor-global-styles-background-panel__inspector-image-indicator {
Expand Down Expand Up @@ -190,7 +193,7 @@
margin-bottom: 0;
}
.components-focal-point-picker__media--image {
max-height: 100px;
max-height: clamp(120px, 9vh, 280px);
}
}

Expand Down
Loading