Skip to content

Commit

Permalink
Merge branch 'banner' of https://github.com/twister65/joomla-cms into…
Browse files Browse the repository at this point in the history
… banner
  • Loading branch information
twister65 committed Aug 24, 2019
2 parents 0814dab + 1a7c59f commit 43ebd61
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions templates/protostar/index.php
Expand Up @@ -52,10 +52,15 @@
// Use of Google Font
if ($this->params->get('googleFont'))
{
JHtml::_('stylesheet', 'https://fonts.googleapis.com/css?family=' . $this->params->get('googleFontName'));
$font = $this->params->get('googleFontName');

// Handle fonts with selected weights and styles, e.g. Source+Sans+Condensed:400,400i
$fontStyle = str_replace('+', ' ', strstr($font, ':', true) ?: $font);

JHtml::_('stylesheet', 'https://fonts.googleapis.com/css?family=' . $font);
$this->addStyleDeclaration("
h1, h2, h3, h4, h5, h6, .site-title {
font-family: '" . str_replace('+', ' ', $this->params->get('googleFontName')) . "', sans-serif;
font-family: '" . $fontStyle . "', sans-serif;
}");
}

Expand Down

0 comments on commit 43ebd61

Please sign in to comment.