Skip to content

Commit 09692b7

Browse files
committed
Now that we're setting font sizes using their presets we don't have to clampify incoming values for the site editor font size picker
1 parent 891dca4 commit 09692b7

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

packages/edit-site/src/components/global-styles/typography-panel.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { __ } from '@wordpress/i18n';
1919
* Internal dependencies
2020
*/
2121
import { getSupportedGlobalStylesPanels, useSetting, useStyle } from './hooks';
22-
import { getTypographyFontSizeValue } from './typography-utils';
2322

2423
export function useHasTypographyPanel( name ) {
2524
const hasFontFamily = useHasFontFamilyControl( name );
@@ -173,19 +172,8 @@ export default function TypographyPanel( { name, element, headingLevel } ) {
173172
} else if ( element && element !== 'text' ) {
174173
prefix = `elements.${ element }.`;
175174
}
176-
const [ fluidTypography ] = useSetting( 'typography.fluid', name );
177175
const [ fontSizes ] = useSetting( 'typography.fontSizes', name );
178176

179-
// Convert static font size values to fluid font sizes if fluidTypography is activated.
180-
const fontSizesWithFluidValues = fontSizes.map( ( font ) => {
181-
if ( !! fluidTypography ) {
182-
font.size = getTypographyFontSizeValue( font, {
183-
fluid: fluidTypography,
184-
} );
185-
}
186-
return font;
187-
} );
188-
189177
const disableCustomFontSizes = ! useSetting(
190178
'typography.customFontSize',
191179
name
@@ -274,7 +262,7 @@ export default function TypographyPanel( { name, element, headingLevel } ) {
274262
<FontSizePicker
275263
value={ fontSize }
276264
onChange={ setFontSize }
277-
fontSizes={ fontSizesWithFluidValues }
265+
fontSizes={ fontSizes }
278266
disableCustomFontSizes={ disableCustomFontSizes }
279267
withReset={ false }
280268
withSlider

0 commit comments

Comments
 (0)