Try this way:
function mytheme_custom_styles() {
// Initialize the variable
$custom_css="";
// check if it's empty
if( '' != get_theme_mod('sitetitle_typography') ) {
$custom_css .= 'font-family: ' . get_theme_mod('sitetitle_typography') . ';';
}
// check if it's empty
if( '' != get_theme_mod('sitetitle_weight') ) {
$custom_css .= 'font-weight: ' . get_theme_mod('sitetitle_weight') . ';';
}
// check if it's empty
if( '' != get_theme_mod('sitetitle_style' ) ) {
$custom_css .= 'font-style: ' . get_theme_mod('sitetitle_style') . ';';
}
// if variable $custom_css has changed, then add the changes and execute wp_add_inline_style
if( '' != $custom_css ) {
$custom_css=".site-title {" . $custom_css . '}';
wp_add_inline_style( 'theme-specific', $custom_css );
}
}
add_action( 'wp_enqueue_scripts', 'mytheme_custom_styles' );
Note that “theme-specific” css stylesheet, had to be enqueued at some point along your theme’s code.
Let me know if it helps you!