diff --git a/packages/edit-site/src/components/editor/utils.js b/packages/edit-site/src/components/editor/utils.js index 3e4044be2f0253..4184f616b29348 100644 --- a/packages/edit-site/src/components/editor/utils.js +++ b/packages/edit-site/src/components/editor/utils.js @@ -17,19 +17,6 @@ export const PRESET_CATEGORIES = { export const LINK_COLOR = '--wp--style--color--link'; export const LINK_COLOR_DECLARATION = `a { color: var(${ LINK_COLOR }, #00e); }`; -/* Helpers for unit processing */ -export const fromPx = ( value ) => { - switch ( typeof value ) { - case 'string': - return +value.replace( 'px', '' ); - case 'number': - default: - return value; - } -}; - -export const toPx = ( value ) => ( value ? value + 'px' : value ); - export function useEditorFeature( featurePath, blockName = GLOBAL_CONTEXT ) { const settings = useSelect( ( select ) => { return select( 'core/edit-site' ).getSettings(); diff --git a/packages/edit-site/src/components/sidebar/typography-panel.js b/packages/edit-site/src/components/sidebar/typography-panel.js index f3717e8a745cc1..ae12093f7c2388 100644 --- a/packages/edit-site/src/components/sidebar/typography-panel.js +++ b/packages/edit-site/src/components/sidebar/typography-panel.js @@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import { fromPx, toPx, useEditorFeature } from '../editor/utils'; +import { useEditorFeature } from '../editor/utils'; export default ( { context: { supports, name }, @@ -32,9 +32,9 @@ export default ( { { supports.includes( 'fontSize' ) && ( - setStyleProperty( name, 'fontSize', toPx( value ) ) + setStyleProperty( name, 'fontSize', value ) } fontSizes={ fontSizes } disableCustomFontSizes={ disableCustomFontSizes }