Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Switch to spacing.units
  • Loading branch information
aaronrobertshaw committed Jul 12, 2021
commit 289a0644c7f6dcfe292827c89adfccb0b2d95f34
1 change: 0 additions & 1 deletion lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class WP_Theme_JSON_Gutenberg {
'customRadius' => null,
'customStyle' => null,
'customWidth' => null,
'units' => null,
),
'color' => array(
'custom' => null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function BorderRadiusControl( { onChange, values } ) {
);

const units = useCustomUnits( {
availableUnits: useSetting( 'border.units' ) || [ 'px', 'em', 'rem' ],
availableUnits: useSetting( 'spacing.units' ) || [ 'px', 'em', 'rem' ],
} );
const unit = getAllUnit( values );
const unitConfig = units.find( ( item ) => item.value === unit );
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/border-width.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const BorderWidthEdit = ( props ) => {
};

const units = useCustomUnits( {
availableUnits: useSetting( 'border.units' ) || [ 'px', 'em', 'rem' ],
availableUnits: useSetting( 'spacing.units' ) || [ 'px', 'em', 'rem' ],
} );

return (
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-site/src/components/sidebar/border-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down