Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian Gardner bgardner

View GitHub Profile
@bgardner
bgardner / style.css
Last active Mar 18, 2021
CSS styles for custom font sizes for the WordPress block editor.
View style.css
/* Text Size
--------------------------------------------- */
.has-tiny-font-size {
font-size: var(--font-size-tiny);
}
.has-small-font-size {
font-size: var(--font-size-small);
}
@bgardner
bgardner / functions.php
Last active Mar 15, 2021
Enable custom font sizes for the WordPress block editor.
View functions.php
<?php
// Do NOT include the opening php tag.
// Enable custom font sizes.
add_theme_support('editor-font-sizes', array(
array(
'name' => esc_attr__('Tiny', 'theme-name') ,
'size' => 14,
'slug' => 'tiny'
) ,