Skip to content

Commit

Permalink
use incremental sequence of numbers as labels
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Dec 15, 2021
1 parent e4f68b6 commit 897948d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/font-size-picker/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ describe( 'FontSizePicker', () => {
expect( element.children ).toHaveLength( 2 );
expect( element.children[ 0 ].textContent ).toBe( '1.7' );
} );
it( 'should use `T-shirt` sizes aliases if we have complex css', () => {
it( 'should use incremental sequence of numbers as labels if we have complex css', () => {
const fontSizes = [
...options,
{
Expand All @@ -224,7 +224,7 @@ describe( 'FontSizePicker', () => {
const element = screen.getByLabelText( 'Large' );
expect( element ).toBeInTheDocument();
expect( element.children ).toHaveLength( 2 );
expect( element.children[ 0 ].textContent ).toBe( 'L' );
expect( element.children[ 0 ].textContent ).toBe( '3' );
} );
} );
} );
Expand Down
10 changes: 5 additions & 5 deletions packages/components/src/font-size-picker/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ const CUSTOM_FONT_SIZE_OPTION = {

/**
* In case we have at most five font sizes, where at least one the them
* contain a complex css value(clamp, var, etc..) show a `T-shirt size`
* alias as a label of the font size. We do this because complex css values
* cannot be caluclated properly and the `T-shirt size` alias can help the
* user better mentally map the different available font sizes.
* contain a complex css value(clamp, var, etc..) show a incremental sequence
* of numbers as a label of the font size. We do this because complex css values
* cannot be caluclated properly and the incremental sequence of numbers as labels
* can help the user better mentally map the different available font sizes.
*/
const FONT_SIZES_ALIASES = [ 'S', 'M', 'L', 'XL', 'XXL' ];
const FONT_SIZES_ALIASES = [ '1', '2', '3', '4', '5' ];

/**
* Helper util to split a font size to its numeric value
Expand Down

0 comments on commit 897948d

Please sign in to comment.