diff --git a/packages/block-library/src/image/image.js b/packages/block-library/src/image/image.js index 6095ef2fee24d..67bf35b6c7331 100644 --- a/packages/block-library/src/image/image.js +++ b/packages/block-library/src/image/image.js @@ -355,15 +355,18 @@ export default function Image( { ); } + const [ lightboxSetting, availableUnits ] = useSettings( + 'lightbox', + 'spacing.units' + ); + // TODO: Can allow more units after figuring out how they should interact // with the ResizableBox and ImageEditor components. Calculations later on // for those components are currently assuming px units. const dimensionsUnitsOptions = useCustomUnits( { - availableUnits: [ 'px' ], + availableUnits: availableUnits || [ 'px', '%', 'vw', 'em', 'rem' ], } ); - const [ lightboxSetting ] = useSettings( 'lightbox' ); - const showLightboxSetting = // If a block-level override is set, we should give users the option to // remove that override, even if the lightbox UI is disabled in the settings.