Skip to content

Commit d51a38e

Browse files
fix (global typography): do not output css if no global typography is present
1 parent 255bc61 commit d51a38e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/global-settings.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,10 @@ public function typography_parse_global_styles() {
590590
}
591591

592592
$selectors = $this->form_selectors( $tag );
593-
$css[] = $this->generate_typography_styles( implode( ', ', $selectors ), $styles );
593+
$typography_css = $this->generate_typography_styles( implode( ', ', $selectors ), $styles );
594+
if ( ! empty( $typography_css ) ) {
595+
$css[] = $typography_css;
596+
}
594597

595598
// Gather the Google Fonts.
596599
if ( isset( $styles['fontFamily'] ) ) {

src/init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function register_frontend_assets() {
127127
wp_register_style( 'ugb-style-css-nodep', false );
128128
$inline_css = apply_filters( 'stackable_inline_styles_nodep', '' );
129129
if ( ! empty( $inline_css ) ) {
130-
wp_add_inline_style( 'ugb-style-css-nodep', $inline_css );
130+
wp_add_inline_style( 'ugb-style-css-nodep', trim( $inline_css ) );
131131
}
132132

133133
// Register inline frontend styles for theme.json block style inheritance

0 commit comments

Comments
 (0)