Themes can declare custom font sizes, giving the publisher specific options to choose from. This is done through a multidimensional array.
- [Instructor] In addition to custom background…and text color, the paragraph block allows the user…to change the font size of each individual paragraph block.…This is done using either the dropdown under text settings…that you can set to any of the predefined sizes…or by using this setting here…where you can set a numerical value for the size you want.…As a theme developer, it's a good idea to control…what sizes are available from this dropdown…so you get sizes that match up with the overall design…of the theme.…That's done by declaring theme support…for editor font sizes.…
And here you'll start seeing a pattern emerging.…You'll remember previously in the course,…we added support for custom color palette…and we created an array of arrays…that has each of the colors defined…while the exact same thing is happening down here…in add theme support editor font sizes.…It's an array of arrays and inside each…of the individual sizes we declare a name.…So this is the human readable name…that's displayed in the dropdown.…
Released
1/22/2019- Declaring support for default block styles
- Adding support and styles for wide alignment
- Supporting theme-specific colors and fonts
- Extending block styles
- Adding new style variations
Share this video
Embed this video
Video: Add support for font sizes