diff --git a/src/google-fonts/font-variant.js b/src/google-fonts/font-variant.js index 54fd1509..46efbc0b 100644 --- a/src/google-fonts/font-variant.js +++ b/src/google-fonts/font-variant.js @@ -32,21 +32,31 @@ function FontVariant( { font, variant, isSelected, handleToggle } ) { } ); }, [ font, variant ] ); + const formattedFontFamily = font.family.toLowerCase().replace( ' ', '-' ); + const fontId = `${ formattedFontFamily }-${ variant }`; + return ( - { weight } - { style } + + + + + + - + ); diff --git a/src/google-fonts/index.js b/src/google-fonts/index.js index f7571260..0cc07b69 100644 --- a/src/google-fonts/index.js +++ b/src/google-fonts/index.js @@ -156,6 +156,13 @@ function GoogleFonts() { setSelectedFont( googleFontsData.items[ value ] ); }; + let selectedFontFamilyId = ''; + if ( selectedFont ) { + selectedFontFamilyId = selectedFont.family + .toLowerCase() + .replace( ' ', '-' ); + } + return (
@@ -235,6 +242,7 @@ function GoogleFonts() { handleToggleAllVariants( selectedFont.family @@ -250,22 +258,34 @@ function GoogleFonts() { /> - { __( - 'Weight', - 'create-block-theme' - ) } + - { __( - 'Style', - 'create-block-theme' - ) } + - { __( - 'Preview', - 'create-block-theme' - ) } +