Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add to functions.php to customize font size options
<?php
add_action( 'wp_enqueue_scripts', 'twenty_seventeen_gutenberg_enqueue_styles' );
// Font size options
function mytheme_setup_theme_supported_features() {
add_theme_support( 'editor-font-sizes', array(
array(
'name' => __( 'extra small', 'themeLangDomain' ),
'shortName' => __( 'xs', 'themeLangDomain' ),
'size' => 10,
'slug' => 'extrasmall'
),
array(
'name' => __( 'small', 'themeLangDomain' ),
'shortName' => __( 's', 'themeLangDomain' ),
'size' => 12,
'slug' => 'extrasmall'
),
array(
'name' => __( 'regular', 'themeLangDomain' ),
'shortName' => __( 'R', 'themeLangDomain' ),
'size' => 16,
'slug' => 'regular'
),
array(
'name' => __( 'medium', 'themeLangDomain' ),
'shortName' => __( 'M', 'themeLangDomain' ),
'size' => 24,
'slug' => 'medium'
),
array(
'name' => __( 'large', 'themeLangDomain' ),
'shortName' => __( 'L', 'themeLangDomain' ),
'size' => 28,
'slug' => 'large'
),
array(
'name' => __( 'larger', 'themeLangDomain' ),
'shortName' => __( 'XL', 'themeLangDomain' ),
'size' => 36,
'slug' => 'larger'
)
) );
// Add Pitzer Orange to the color palette block
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'Pitzer Orange', 'themeLangDomain' ),
'slug' => 'pitzer-orange',
'color' => '#f7941d',
),
) );
}
add_action( 'after_setup_theme', 'mytheme_setup_theme_supported_features' );
@josephdickson

This comment has been minimized.

Copy link
Owner Author

josephdickson commented Oct 18, 2018

Custom code to adjust font sizes available in the Gutenberg paragraph block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.