Skip to content
This repository was archived by the owner on Jan 25, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions build/media_source/fonts/fira-sans.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
font-weight: 400;
font-display:swap;
src: local('Fira Sans Regular'), local('FiraSans-Regular'),
url('./fira-sans-v10-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./fira-sans-v10-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
url('./fira-sans/fira-sans-v10-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./fira-sans/fira-sans-v10-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* fira-sans-italic - latin */
Expand All @@ -16,8 +16,8 @@
font-weight: 400;
font-display:swap;
src: local('Fira Sans Italic'), local('FiraSans-Italic'),
url('./fira-sans-v10-latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./fira-sans-v10-latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
url('./fira-sans/fira-sans-v10-latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./fira-sans/fira-sans-v10-latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* fira-sans-700 - latin */
Expand All @@ -27,8 +27,8 @@
font-weight: 700;
font-display:swap;
src: local('Fira Sans Bold'), local('FiraSans-Bold'),
url('./fira-sans-v10-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./fira-sans-v10-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
url('./fira-sans/fira-sans-v10-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./fira-sans/fira-sans-v10-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* fira-sans-700italic - latin */
Expand All @@ -38,8 +38,8 @@
font-weight: 700;
font-display:swap;
src: local('Fira Sans Bold Italic'), local('FiraSans-BoldItalic'),
url('./fira-sans-v10-latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./fira-sans-v10-latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
url('./fira-sans/fira-sans-v10-latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./fira-sans/fira-sans-v10-latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

:root {
Expand Down
24 changes: 12 additions & 12 deletions build/media_source/fonts/josefin-sans.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
font-weight: 400;
font-display: swap;
src: local(''),
url('./josefin-sans-v16-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./josefin-sans-v16-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
url('./josefin-sans/josefin-sans-v16-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./josefin-sans/josefin-sans-v16-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* josefin-sans-600 - latin */
Expand All @@ -16,8 +16,8 @@
font-weight: 600;
font-display:swap;
src: local(''),
url('./josefin-sans-v16-latin-600.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./josefin-sans-v16-latin-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
url('./josefin-sans/josefin-sans-v16-latin-600.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./josefin-sans/josefin-sans-v16-latin-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* josefin-sans-700 - latin */
Expand All @@ -27,8 +27,8 @@
font-weight: 700;
font-display:swap;
src: local(''),
url('./josefin-sans-v16-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./josefin-sans-v16-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
url('./josefin-sans/josefin-sans-v16-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./josefin-sans/josefin-sans-v16-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* josefin-sans-italic - latin */
Expand All @@ -38,8 +38,8 @@
font-weight: 400;
font-display:swap;
src: local(''),
url('./josefin-sans-v16-latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./josefin-sans-v16-latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
url('./josefin-sans/josefin-sans-v16-latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./josefin-sans/josefin-sans-v16-latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* josefin-sans-600italic - latin */
Expand All @@ -49,8 +49,8 @@
font-weight: 600;
font-display:swap;
src: local(''),
url('./josefin-sans-v16-latin-600italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./josefin-sans-v16-latin-600italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
url('./josefin-sans/josefin-sans-v16-latin-600italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./josefin-sans/josefin-sans-v16-latin-600italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* josefin-sans-700italic - latin */
Expand All @@ -60,8 +60,8 @@
font-weight: 700;
font-display:swap;
src: local(''),
url('./josefin-sans-v16-latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./josefin-sans-v16-latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
url('./josefin-sans/josefin-sans-v16-latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./josefin-sans/josefin-sans-v16-latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

:root {
Expand Down
2 changes: 1 addition & 1 deletion installation/sql/mysql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ CREATE TABLE IF NOT EXISTS `#__template_styles` (

INSERT INTO `#__template_styles` (`id`, `template`, `client_id`, `home`, `title`, `inheritable`, `parent`, `params`) VALUES
(10, 'atum', 1, '1', 'atum - Default', 0, '', ''),
(11, 'cassiopeia', 0, '1', 'cassiopeia - Default', 0, '', '{"logoFile":"","fluidContainer":"0","sidebarLeftWidth":"3","sidebarRightWidth":"3","googleFont":"1","googleFontName":"fira-sans"}');
(11, 'cassiopeia', 0, '1', 'cassiopeia - Default', 0, '', '{"logoFile":"","fluidContainer":"0","sidebarLeftWidth":"3","sidebarRightWidth":"3","includeFont":"media/fonts/fira-sans.css"}');

-- --------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion installation/sql/postgresql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ CREATE INDEX "#__template_styles_idx_client_id_home" ON "#__template_styles" ("c
--
INSERT INTO "#__template_styles" ("id", "template", "client_id", "home", "title", "inheritable", "parent", "params") VALUES
(10, 'atum', 1, '1', 'atum - Default', 0, '', ''),
(11, 'cassiopeia', 0, '1', 'cassiopeia - Default', 0, '', '{"logoFile":"","fluidContainer":"0","sidebarLeftWidth":"3","sidebarRightWidth":"3","googleFont":"1","googleFontName":"fira-sans"}');
(11, 'cassiopeia', 0, '1', 'cassiopeia - Default', 0, '', '{"logoFile":"","fluidContainer":"0","sidebarLeftWidth":"3","sidebarRightWidth":"3","includeFont":"media/fonts/fira-sans.css"}');

SELECT setval('#__template_styles_id_seq', 12, false);

Expand Down
6 changes: 1 addition & 5 deletions language/en-GB/tpl_cassiopeia.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,4 @@ TPL_CASSIOPEIA_STATIC="Static"
TPL_CASSIOPEIA_STICKY_LABEL="Sticky Header"
TPL_CASSIOPEIA_TOGGLE="Toggle Navigation"
TPL_CASSIOPEIA_XML_DESCRIPTION="Continuing the space theme (Solarflare from 1.0, Milkyway from 1.5 and Protostar from 3.0), Cassiopeia is the Joomla 4 site template based on Bootstrap 4."
TPL_CASSIOPEIA_FONT_LABEL="Google font for text and headings"
TPL_CASSIOPEIA_FONT_DESC="Load Google font for text and headings (H1, H2, H3, etc)."
TPL_CASSIOPEIA_FONT_NAME_LABEL="Google Font Name"
TPL_CASSIOPEIA_FONT_NAME_DESC="Example: only one font Josefin Sans or a font combination Montserrat + Work Sans."

TPL_CASSIOPEIA_FONT_LABEL="Extra Font(s)"
19 changes: 8 additions & 11 deletions templates/cassiopeia/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,16 @@
// Override 'template.active' asset to set correct ltr/rtl dependency
$wa->registerStyle('template.active', '', [], [], ['template.cassiopeia.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')]);

// Use of Google Font
if ($this->params->get('googleFont'))
{
// Preload the stylesheet for the font, actually we need to preload the font
$paramsFontName = $this->params->get('googleFontName');
// Use of extra font(s)
$paramsIncludeFont = $this->params->get('includeFont');

if ($paramsFontName)
{
$assetFontName = 'font.' . $paramsFontName;
if ($paramsIncludeFont)
{
// Preload the stylesheet for the font or combination of fonts, actually we need to preload the font(s)
$assetFontName = 'template.cassiopeia.font.' . basename($paramsIncludeFont);

$wa->registerAndUseStyle($assetFontName, 'media/fonts/' . $paramsFontName . '.css');
$this->getPreloadManager()->preload($wa->getAsset('style', $assetFontName)->getUri(), ['as' => 'style']);
}
$wa->registerAndUseStyle($assetFontName, $paramsIncludeFont);
$this->getPreloadManager()->preload($wa->getAsset('style', $assetFontName)->getUri(), ['as' => 'style']);
}

// Logo file or site title param
Expand Down
28 changes: 7 additions & 21 deletions templates/cassiopeia/templateDetails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,30 +105,16 @@
</field>

<field
name="googleFont"
type="radio"
name="includeFont"
type="list"
label="TPL_CASSIOPEIA_FONT_LABEL"
description="TPL_CASSIOPEIA_FONT_DESC"
class="btn-group btn-group-yesno"
default="1"
default="media/fonts/fira-sans.css"
validate="options"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
<option value="0">JNONE</option>
<option value="media/fonts/fira-sans.css">Fira Sans</option>
<option value="media/fonts/josefin-sans.css">Josefin Sans</option>
</field>

<field
name="googleFontName"
type="filelist"
label="TPL_CASSIOPEIA_FONT_NAME_LABEL"
description="TPL_CASSIOPEIA_FONT_NAME_DESC"
stripext="1"
directory="media/fonts/"
hide_none="1"
hide_default="1"
fileFilter="\.css$"
exclude="\.min\.css$"
showon="googleFont:1"
/>
</fieldset>
</fields>
</config>
Expand Down