diff --git a/packages/components/src/font-size-picker/index.tsx b/packages/components/src/font-size-picker/index.tsx index 9cc577e445121..aa81e4ef668d3 100644 --- a/packages/components/src/font-size-picker/index.tsx +++ b/packages/components/src/font-size-picker/index.tsx @@ -9,6 +9,7 @@ import type { ForwardedRef } from 'react'; import { __ } from '@wordpress/i18n'; import { settings } from '@wordpress/icons'; import { useState, forwardRef } from '@wordpress/element'; +import { useInstanceId } from '@wordpress/compose'; /** * Internal dependencies @@ -21,7 +22,6 @@ import { parseQuantityAndUnitFromRawValue, useCustomUnits, } from '../unit-control'; -import { VisuallyHidden } from '../visually-hidden'; import type { FontSizePickerProps } from './types'; import { Container, Header, HeaderLabel, HeaderToggle } from './styles'; import { Spacer } from '../spacer'; @@ -50,6 +50,11 @@ const UnforwardedFontSizePicker = ( withReset = true, } = props; + const labelId = useInstanceId( + UnforwardedFontSizePicker, + 'font-size-picker-label' + ); + const units = useCustomUnits( { availableUnits: unitsProp, } ); @@ -100,11 +105,17 @@ const UnforwardedFontSizePicker = ( } ); return ( - - { __( 'Font size' ) } +
- { __( 'Font size' ) } + + { __( 'Font size' ) } + { ! disableCustomFontSizes && (