Skip to content

Commit 43ebd61

Browse files
committed
2 parents 0814dab + 1a7c59f commit 43ebd61

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

templates/protostar/index.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,15 @@
5252
// Use of Google Font
5353
if ($this->params->get('googleFont'))
5454
{
55-
JHtml::_('stylesheet', 'https://fonts.googleapis.com/css?family=' . $this->params->get('googleFontName'));
55+
$font = $this->params->get('googleFontName');
56+
57+
// Handle fonts with selected weights and styles, e.g. Source+Sans+Condensed:400,400i
58+
$fontStyle = str_replace('+', ' ', strstr($font, ':', true) ?: $font);
59+
60+
JHtml::_('stylesheet', 'https://fonts.googleapis.com/css?family=' . $font);
5661
$this->addStyleDeclaration("
5762
h1, h2, h3, h4, h5, h6, .site-title {
58-
font-family: '" . str_replace('+', ' ', $this->params->get('googleFontName')) . "', sans-serif;
63+
font-family: '" . $fontStyle . "', sans-serif;
5964
}");
6065
}
6166

0 commit comments

Comments
 (0)