From 6bae6569db928cac423c7e494ba5e9067f1bfb31 Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Wed, 4 Nov 2020 22:02:51 +0000 Subject: [PATCH] Fix: Font size picker does not correctly handles big font sizes. (#26705) --- packages/components/src/font-size-picker/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/components/src/font-size-picker/index.js b/packages/components/src/font-size-picker/index.js index 6909af4068f3e..e9e67b9b654ec 100644 --- a/packages/components/src/font-size-picker/index.js +++ b/packages/components/src/font-size-picker/index.js @@ -21,6 +21,7 @@ import VisuallyHidden from '../visually-hidden'; const DEFAULT_FONT_SIZE = 'default'; const CUSTOM_FONT_SIZE = 'custom'; +const MAX_FONT_SIZE_DISPLAY = '25px'; function getSelectValueFromFontSize( fontSizes, value ) { if ( value ) { @@ -45,7 +46,9 @@ function getSelectOptions( optionsArray, disableCustomFontSizes ) { key: option.slug, name: option.name, size: option.size, - style: { fontSize: option.size }, + style: { + fontSize: `min( ${ option.size }, ${ MAX_FONT_SIZE_DISPLAY } )`, + }, } ) ); }