Skip to content

Commit

Permalink
Merge branch 'staging' into banner
Browse files Browse the repository at this point in the history
  • Loading branch information
twister65 committed Aug 24, 2019
2 parents 06d45be + 81d7fcf commit 1a7c59f
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 1a7c59f

Please sign in to comment.