Skip to content
This repository was archived by the owner on Jan 25, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7f982e1
Remove media/fonts
richard67 Sep 5, 2020
fa14734
Rework fonts option
richard67 Sep 5, 2020
c46187f
Add new scss files to css compile script
richard67 Sep 5, 2020
20262cc
Fix the file names
richard67 Sep 5, 2020
0a8ac1d
Fix css import and remove validate options
richard67 Sep 5, 2020
090e14c
Use CSS variables, rename scss files
richard67 Sep 5, 2020
50fb86e
Add web fonts combination Noto Sans + Roboto
richard67 Sep 5, 2020
7175fab
Adapt css compile script to changes
richard67 Sep 5, 2020
fd839cc
Fix variables and loading order
richard67 Sep 5, 2020
76791eb
Fix poppins font weight for headings
richard67 Sep 5, 2020
2b2e535
Fix asset URI
richard67 Sep 5, 2020
ad117d7
Fix default parameter value
richard67 Sep 5, 2020
90e04af
Remove obsolete parameters from base.sql
richard67 Sep 5, 2020
c731593
Add a warning about disadvantages of web fonts and local fonts
richard67 Sep 5, 2020
61a2032
Change language string name for note
richard67 Sep 5, 2020
2278494
Fix capitalization in note title
richard67 Sep 5, 2020
44c5b73
Change fields oder in template style options
richard67 Sep 5, 2020
a3203b4
Change CSS variable for body font family
richard67 Sep 5, 2020
38113a8
Some code style and comment changes
richard67 Sep 5, 2020
33cb11f
keep language strings in alphabetical order
hans2103 Sep 7, 2020
e40b53c
Merge remote-tracking branch 'upstream/development' into development-…
richard67 Sep 7, 2020
105c206
Fix label capitalisation
richard67 Sep 7, 2020
a64ce49
Move switcher below list field for better look
richard67 Sep 7, 2020
034f527
Improve and shorten note text
richard67 Sep 7, 2020
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
5 changes: 4 additions & 1 deletion build/build-modules-js/compilecss.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ module.exports.compile = (options, path) => {
`${RootPath}/templates/cassiopeia/scss/offline.scss`,
`${RootPath}/templates/cassiopeia/scss/template.scss`,
`${RootPath}/templates/cassiopeia/scss/template-rtl.scss`,
`${RootPath}/templates/cassiopeia/scss/global/fonts-local_roboto.scss`,
`${RootPath}/templates/cassiopeia/scss/global/fonts-web_poppins+roboto.scss`,
`${RootPath}/templates/cassiopeia/scss/global/fonts-web_roboto+noto-sans.scss`,
`${RootPath}/templates/cassiopeia/scss/global/colors_autumn.scss`,
`${RootPath}/templates/cassiopeia/scss/global/colors_spring.scss`,
`${RootPath}/templates/cassiopeia/scss/global/colors_summer.scss`,
Expand Down Expand Up @@ -71,7 +74,7 @@ module.exports.compile = (options, path) => {

// Loop to get the files that should be compiled via parameter
folders.forEach((folder) => {
Recurs(folder, ['*.js', '*.map', '*.svg', '*.png', '*.gif', '*.swf', '*.html', '*.json', '*.woff', '*.woff2']).then(
Recurs(folder, ['*.js', '*.map', '*.svg', '*.png', '*.gif', '*.swf', '*.html', '*.json']).then(
(filesRc) => {
filesRc.forEach(
(file) => {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
52 changes: 0 additions & 52 deletions build/media_source/fonts/fira-sans.scss

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
79 changes: 0 additions & 79 deletions build/media_source/fonts/josefin-sans.scss

This file was deleted.

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"}');

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

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"}');

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

Expand Down
9 changes: 4 additions & 5 deletions language/en-GB/tpl_cassiopeia.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ TPL_CASSIOPEIA_COLOR_NAME_SUMMER="Summer"
TPL_CASSIOPEIA_COLOR_NAME_WINTER="Winter"
TPL_CASSIOPEIA_FLUID="Fluid"
TPL_CASSIOPEIA_FLUID_LABEL="Fluid Layout"
TPL_CASSIOPEIA_FONT_GROUP_LOCAL="Fonts from Folder"
TPL_CASSIOPEIA_FONT_GROUP_WEB="Fonts from Web"
TPL_CASSIOPEIA_FONT_LABEL="Fonts Scheme"
TPL_CASSIOPEIA_FONT_NOTE_TEXT="Loading fonts from external sources might be against privacy regulations in some countries.<br>Loading fonts from a local folder might have a performance impact on your site."
TPL_CASSIOPEIA_LOGO_LABEL="Logo"
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."

26 changes: 11 additions & 15 deletions templates/cassiopeia/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@
$wa->registerAndUseStyle($assetColorName, $templatePath . '/css/global/' . $paramsColorName . '.css');
$this->getPreloadManager()->preload($wa->getAsset('style', $assetColorName)->getUri(), ['as' => 'style']);

// Use a font scheme if not "None" is set in the template style options
$paramsFontScheme = $this->params->get('useFontScheme', 'fonts-local_roboto');

if ($paramsFontScheme)
{
// Preload the stylesheet for the font scheme, actually we need to preload the font(s)
$assetFontScheme = 'fontscheme.' . $paramsFontScheme;
$wa->registerAndUseStyle($assetFontScheme, $templatePath . '/css/global/' . $paramsFontScheme . '.css');
$this->getPreloadManager()->preload($wa->getAsset('style', $assetFontScheme)->getUri(), ['as' => 'style']);
}

// Enable assets
$wa->usePreset('template.cassiopeia.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr'))
->useStyle('template.active.language')
Expand All @@ -46,21 +57,6 @@
// 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');

if ($paramsFontName)
{
$assetFontName = 'font.' . $paramsFontName;

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

// Logo file or site title param
if ($this->params->get('logoFile'))
{
Expand Down
4 changes: 3 additions & 1 deletion templates/cassiopeia/scss/blocks/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ html {
}

body {
font-family: var(--cassiopeia-font-family-body);
padding: 0;
margin: 0;
line-height: 1.6;
Expand All @@ -29,7 +30,8 @@ h3,
h4,
h5,
h6 {
font-weight: bold;
font-family: var(--cassiopeia-font-family-headings);
font-weight: var(--cassiopeia-font-weight-headings);
}

a {
Expand Down
8 changes: 8 additions & 0 deletions templates/cassiopeia/scss/global/fonts-local_roboto.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Fonts
@import "../../../media/vendor/roboto-fontface/scss/roboto/roboto-fontface.css";

:root {
--cassiopeia-font-family-body: "Roboto", sans-serif;
--cassiopeia-font-family-headings: "Roboto", sans-serif;
--cassiopeia-font-weight-headings: bold;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Fonts
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;700&family=Roboto:wght@400;700&display=swap');

:root {
--cassiopeia-font-family-body: "Roboto", sans-serif;
--cassiopeia-font-family-headings: "Poppins", sans-serif;
--cassiopeia-font-weight-headings: normal;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Fonts
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@100;300;400;700&family=Roboto:wght@100;300;400;700&display=swap');

:root {
--cassiopeia-font-family-body: "Noto Sans", sans-serif;
--cassiopeia-font-family-headings: "Roboto", sans-serif;
--cassiopeia-font-weight-headings: normal;
}
64 changes: 31 additions & 33 deletions templates/cassiopeia/templateDetails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,29 @@
/>

<field
name="fluidContainer"
type="radio"
layout="joomla.form.field.radio.switcher"
default="0"
label="TPL_CASSIOPEIA_FLUID_LABEL"
name="useFontScheme"
type="groupedlist"
label="TPL_CASSIOPEIA_FONT_LABEL"
default="fonts-local_roboto"
>
<option value="1">TPL_CASSIOPEIA_FLUID</option>
<option value="0">TPL_CASSIOPEIA_STATIC</option>
<option value="0">JNONE</option>
<group label="TPL_CASSIOPEIA_FONT_GROUP_LOCAL">
<option value="fonts-local_roboto">Roboto (local)</option>
</group>
<group label="TPL_CASSIOPEIA_FONT_GROUP_WEB">
<option value="fonts-web_poppins+roboto">Poppins + Roboto (web)</option>
<option value="fonts-web_roboto+noto-sans">Roboto + Noto Sans (web)</option>
</group>
</field>

<field
name="noteFontScheme"
type="note"
label="TPL_CASSIOPEIA_FONT_NOTE_TEXT"
heading="p"
class="alert alert-warning"
/>

<field
name="colorName"
type="list"
Expand All @@ -92,6 +105,17 @@
<option value="colors_winter">TPL_CASSIOPEIA_COLOR_NAME_WINTER</option>
</field>

<field
name="fluidContainer"
type="radio"
layout="joomla.form.field.radio.switcher"
default="0"
label="TPL_CASSIOPEIA_FLUID_LABEL"
>
<option value="1">TPL_CASSIOPEIA_FLUID</option>
<option value="0">TPL_CASSIOPEIA_STATIC</option>
</field>

<field
name="stickyHeader"
type="radio"
Expand All @@ -115,32 +139,6 @@
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="googleFont"
type="radio"
label="TPL_CASSIOPEIA_FONT_LABEL"
description="TPL_CASSIOPEIA_FONT_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option value="1">JYES</option>
<option value="0">JNO</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