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

Enable themes to disable setting a custom font size #9168

Closed
LittleBigThing opened this issue Aug 20, 2018 · 3 comments
Closed

Enable themes to disable setting a custom font size #9168

LittleBigThing opened this issue Aug 20, 2018 · 3 comments
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Type] Enhancement A suggestion for improvement.

Comments

@LittleBigThing
Copy link

Themes may provide a set of font sizes for blocks that support this. By default, users can select from the given sizes (for example 'L' for 'large' defining a certain font size), but also set a custom font size. However, it would be useful if setting a custom font size could be disabled by themes.

Similar idea when setting colors

This request is similar to the feature implemented for colors. A color palette can be defined by the theme and by default, custom colors can be added by the user from a color picker. This latter can be disabled by:

add_theme_support( 'disable-custom-colors' );

A similar feature could be added to setting the font size:

add_theme_support( 'disable-custom-font-size' );

Reasoning

Setting the font size can be useful for the user to emphasize a certain paragraph, for example. This can give great results when the theme supports the classes added based the selected font size. Support from the theme is crucial because it can define the sizes based on the given class and adjust the size according to screen size. In my opinion, this is the cleanest way allowing different font sizes.

When the user selects a custom font size using the slider, the font-size is set inline:

style="font-size:36px;"

This means that the font size is set for each screen size. A large value can look gigantic on a small screen and vica versa. In my opinion, there is no proper way for a theme to control this.

This solution might look like this:

screen shot 2018-08-20 at 16 26 31

@0aveRyan
Copy link
Contributor

Particularly with the inclusion of Heading and Subheading blocks, this seems reasonable to allow theme developers to do.

@designsimply designsimply added [Type] Enhancement A suggestion for improvement. [Feature] Extensibility The ability to extend blocks or the editing experience labels Aug 20, 2018
@LittleBigThing
Copy link
Author

In the meantime I found that @mtias is mentioning in #5360 that using inline styles is in the advanced category of customization and for these, the following applies:

For basic we avoid all saved inline styles, and advanced is something that could be disabled by a theme or plugin if necessary.

So there may be plans already with regard to the above.

chrisvanpatten added a commit that referenced this issue Oct 17, 2018
* Allow disabling custom font size settings; fixes #9168

* Update documentation
@LittleBigThing
Copy link
Author

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants