Skip to content

Commit f4b9f6a

Browse files
authored
fix (blocksy): add support for CSS custom property font family (#3436)
Co-authored-by: [email protected] <>
1 parent f65d27e commit f4b9f6a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/global-settings.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,11 @@ public function get_font_family( $font_name ) {
688688
return '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';
689689
}
690690

691+
// If the font is a CSS custom property, return it directly.
692+
if ( strpos( $font_name, 'var(' ) === 0 ) {
693+
return $font_name;
694+
}
695+
691696
// Google font.
692697
return '"' . $font_name . '", sans-serif';
693698
}

src/util/font.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ export const isGoogleFontEnqueued = ( fontName, head = document.querySelector( '
8989
}
9090

9191
export const getFontFamily = fontName => {
92+
// If the font is a CSS custom property, return it directly.
93+
if ( fontName.match( /^\s*var\(--/ ) ) {
94+
return fontName
95+
}
96+
9297
// Google Font.
9398
if ( isWebFont( fontName ) ) {
9499
return `"${ fontName }", Sans-serif`

0 commit comments

Comments
 (0)