Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font Size Picker: Add default size #18273

Merged
merged 6 commits into from
Dec 18, 2019
Merged

Font Size Picker: Add default size #18273

merged 6 commits into from
Dec 18, 2019

Conversation

mmtr
Copy link
Contributor

@mmtr mmtr commented Nov 4, 2019

Description

Adds a default option to the font size picker component that unsets any font size.

Previously, the font size selector was falling back to the normal size, but this size might have not been defined by theme.

Fixes #17908

How has this been tested?

  • Activated the Twenty Twenty theme or any other theme providing font sizes not including a normal size (Twenty Twenty recently added a normal font size: Swap slug for regular font size to normal so it shows as default twentytwenty#989).
  • Created a new post and added some paragraph blocks.
  • Made sure the Text Settings on the right sidebar has the "Default" font size, with no font size applied to the block.
  • Tried setting any other font size and made sure it worked as expected.
  • Clicked on "Reset" and verified the selector changed to "Default", with no font size applied to the block.
  • Removed the font size number (after toggling any font size) and verified the selector changed to "Default", with no font size applied to the block.

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@mmtr mmtr added the [Package] Components /packages/components label Nov 4, 2019
@mmtr mmtr self-assigned this Nov 4, 2019
@kwight
Copy link

kwight commented Nov 13, 2019

Works great 👍

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments, but the general idea looks good to me :)

@mmtr mmtr force-pushed the fix/17908-default-font-size branch from b1aaff8 to c27a740 Compare November 15, 2019 09:51
@mmtr mmtr force-pushed the fix/17908-default-font-size branch from c27a740 to 62ee44f Compare November 29, 2019 12:52
@mmtr mmtr requested review from nerrad and ntwb as code owners November 29, 2019 13:32
@mmtr mmtr force-pushed the fix/17908-default-font-size branch from 50a5478 to 88114ee Compare November 29, 2019 14:26
@mmtr mmtr force-pushed the fix/17908-default-font-size branch from 88114ee to 4e9be65 Compare December 16, 2019 17:21
Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well on my tests 👍

@mmtr mmtr merged commit a039edb into master Dec 18, 2019
@mmtr mmtr deleted the fix/17908-default-font-size branch December 18, 2019 10:02
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Font Size Picker inconsistencies--is "normal" a required size?
4 participants