diff --git a/packages/block-editor/src/components/border-radius-control/index.js b/packages/block-editor/src/components/border-radius-control/index.js index 7d5233d5cabe6..02b05f2fb2e82 100644 --- a/packages/block-editor/src/components/border-radius-control/index.js +++ b/packages/block-editor/src/components/border-radius-control/index.js @@ -15,6 +15,7 @@ import { __ } from '@wordpress/i18n'; import AllInputControl from './all-input-control'; import InputControls from './input-controls'; import LinkedButton from './linked-button'; +import useSetting from '../use-setting'; import { getAllValue, getAllUnit, @@ -49,9 +50,11 @@ export default function BorderRadiusControl( { onChange, values } ) { ! hasDefinedValues( values ) || ! hasMixedValues( values ) ); - const units = useCustomUnits( { availableUnits: [ 'px', 'em', 'rem' ] } ); + const units = useCustomUnits( { + availableUnits: useSetting( 'spacing.units' ) || [ 'px', 'em', 'rem' ], + } ); const unit = getAllUnit( values ); - const unitConfig = units.find( ( item ) => item.value === unit ); + const unitConfig = units && units.find( ( item ) => item.value === unit ); const step = unitConfig?.step || 1; const [ allValue ] = parseUnit( getAllValue( values ) ); diff --git a/packages/block-editor/src/components/border-style-control/style.scss b/packages/block-editor/src/components/border-style-control/style.scss index 737103be1cd24..d8232bd40bb55 100644 --- a/packages/block-editor/src/components/border-style-control/style.scss +++ b/packages/block-editor/src/components/border-style-control/style.scss @@ -1,5 +1,6 @@ .components-border-style-control { legend { + line-height: 1.2; padding-bottom: $grid-unit-05; } diff --git a/packages/edit-site/src/components/sidebar/border-panel.js b/packages/edit-site/src/components/sidebar/border-panel.js index 85f36bc10253e..e7d5c801ff935 100644 --- a/packages/edit-site/src/components/sidebar/border-panel.js +++ b/packages/edit-site/src/components/sidebar/border-panel.js @@ -69,7 +69,7 @@ export default function BorderPanel( { setStyle, } ) { const units = useCustomUnits( { - availableUnits: [ 'px', 'em', 'rem' ], + availableUnits: useSetting( 'spacing.units' ) || [ 'px', 'em', 'rem' ], } ); // Border width.