Skip to content

Commit

Permalink
Fix: Font size picker does not correctly handles big font sizes. (#26705
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jorgefilipecosta authored Nov 4, 2020
1 parent 73d7e22 commit 6bae656
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/components/src/font-size-picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand All @@ -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 } )`,
},
} ) );
}

Expand Down

0 comments on commit 6bae656

Please sign in to comment.