Enable themes to disable setting a custom font size #9168
Labels
[Feature] Extensibility
The ability to extend blocks or the editing experience
[Type] Enhancement
A suggestion for improvement.
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:
The text was updated successfully, but these errors were encountered: