Skip to content

Commit f02f192

Browse files
authored
Modify Cassiopeia for Joomla 6 (#45624)
* Modify Cassiopeia for Joomla 6 * Separate settings in fieldsets * Added a separate CSS file for font settings
1 parent ddfe0d2 commit f02f192

File tree

11 files changed

+430
-4
lines changed

11 files changed

+430
-4
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
.container-header {
2+
background-color: var(--headerbg);
3+
background-image: none;
4+
.navbar-brand a {
5+
color: var(--headercolor);
6+
text-decoration: none;
7+
}
8+
.mod-menu {
9+
color: var(--headercolor);
10+
}
11+
}
12+
.container-header .metismenu > li > a:hover::after, .container-header .metismenu > li > button:hover::before, .container-header .metismenu > li.active > a::after, .container-header .metismenu > li.active > button::before {
13+
background: color-mix(in srgb, currentColor, #fff 25%);
14+
}
15+
a:focus-visible,
16+
.metismenu.mod-menu .metismenu-item > a:focus,
17+
.metismenu.mod-menu .metismenu-item > button:focus {
18+
outline: 2px solid currentColor;
19+
outline-offset: 2px;
20+
}
21+
.form-control:focus,
22+
.form-check-input:focus {
23+
outline: 2px solid currentColor;
24+
outline-offset: 2px;
25+
box-shadow: none;
26+
}
27+
.form-check-input:checked {
28+
background-color: var(--body-color);
29+
border-color: var(--body-color);
30+
}
31+
.btn-primary {
32+
--btn-color: var(--btncolor);
33+
--btn-bg: var(--btnbg);
34+
--btn-border-color: var(--btnbg);
35+
--btn-hover-color: var(--btncolor);
36+
--btn-hover-bg: var(--btnbgh);
37+
--btn-hover-border-color: var(--btnbgh);
38+
--btn-active-color: var(--btncolor);
39+
--btn-active-bg: var(--btnbgh);
40+
--btn-active-border-color: var(--btnbgh);
41+
--btn-disabled-color: var(--btncolor);
42+
--btn-disabled-bg: var(--btnbg);
43+
--btn-disabled-border-color: var(--btnbg);
44+
}
45+
.btn-primary {
46+
background-color: var(--btn-bg);
47+
border-color: var(--btn-bg);
48+
&:hover,
49+
&:focus {
50+
background-color: var(--btn-hover-bg);
51+
border-color: var(--btn-hover-bg);
52+
}
53+
}
54+
.btn-primary:focus-visible {
55+
outline: 2px solid var(--btn-hover-bg);
56+
outline-offset: 2px;
57+
box-shadow: none;
58+
}
59+
.boxed .blog-item {
60+
--cassiopeia-color-primary: var(--link-color);
61+
}
62+
.pagination {
63+
--pagination-active-bg: var(--link-color);
64+
}
65+
.container-footer {
66+
color: var(--footercolor);
67+
background-color: var(--footerbg);
68+
background-image: none;
69+
a {
70+
color: var(--footercolor);
71+
}
72+
}
73+
.offline-card .header {
74+
color: var(--headercolor);
75+
background-color: var(--headerbg);
76+
background-image: none;
77+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@media (width >= 1200px) {
2+
h1, .h1 {
3+
font-size: var(--h1size);
4+
}
5+
h2, .h2 {
6+
font-size: var(--h2size);
7+
}
8+
h3, .h3 {
9+
font-size: var(--h3size);
10+
}
11+
}

installation/sql/mysql/base.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`,
413413
-- Templates
414414
INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES
415415
(0, 'atum', 'template', 'atum', '', 1, 1, 1, 0, 1, '', '', '', 0, 0),
416-
(0, 'cassiopeia', 'template', 'cassiopeia', '', 0, 1, 1, 0, 1, '', '{"brand":"1","logoFile":"","siteTitle":"","siteDescription":"","useFontScheme":"0","colorName":"colors_standard","fluidContainer":"0","stickyHeader":0,"backTop":0}', '', 0, 0);
416+
(0, 'cassiopeia', 'template', 'cassiopeia', '', 0, 1, 1, 0, 1, '', '{"brand":"1","logoFile":"","siteTitle":"","siteDescription":"","useFontScheme":"0","colorName":"colors_standard","fluidContainer":"0","stickyHeader":0,"backTop":0",colorSettings":1,"headerbg":"rgb(193, 205, 207)","headercolor":"rgb(23, 23, 23)","bodybg":"rgb(254, 254, 254)","bodycolor":"rgb(23, 23, 23)","linkcolor":"rgb(29, 121, 137)","linkcolorh":"rgb(14, 59, 67)","btnbg":"rgb(206, 60, 55)","btnbgh":"rgb(131, 35, 32)","btncolor":"rgb(254, 254, 254)","btncolorh":"rgb(254, 254, 254)","footerbg":"rgb(29, 121, 137)","footercolor":"rgb(254, 254, 254)","fontSettings":1,"bodysize":"1","h1size":"2","h2size":"1.7","h3size":"1.5"}', '', 0, 0);
417417

418418
-- Files Extensions
419419
INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES
@@ -846,7 +846,7 @@ CREATE TABLE IF NOT EXISTS `#__template_styles` (
846846

847847
INSERT INTO `#__template_styles` (`id`, `template`, `client_id`, `home`, `title`, `inheritable`, `parent`, `params`) VALUES
848848
(10, 'atum', 1, '1', 'Atum - Default', 1, '', '{"hue":"hsl(214, 63%, 20%)","bg-light":"#f0f4fb","text-dark":"#495057","text-light":"#ffffff","link-color":"#2a69b8","special-color":"#001b4c","colorScheme":"os","monochrome":"0","loginLogo":"","loginLogoAlt":"","logoBrandLarge":"","logoBrandLargeAlt":"","logoBrandSmall":"","logoBrandSmallAlt":""}'),
849-
(11, 'cassiopeia', 0, '1', 'Cassiopeia - Default', 1, '', '{"brand":"1","logoFile":"","siteTitle":"","siteDescription":"","useFontScheme":"0","colorName":"colors_standard","fluidContainer":"0","stickyHeader":0,"backTop":0}');
849+
(11, 'cassiopeia', 0, '1', 'Cassiopeia - Default', 1, '', '{"brand":"1","logoFile":"","siteTitle":"","siteDescription":"","useFontScheme":"0","colorName":"colors_standard","fluidContainer":"0","stickyHeader":0,"backTop":0,"colorSettings":1,"headerbg":"rgb(193, 205, 207)","headercolor":"rgb(23, 23, 23)","bodybg":"rgb(254, 254, 254)","bodycolor":"rgb(23, 23, 23)","linkcolor":"rgb(29, 121, 137)","linkcolorh":"rgb(14, 59, 67)","btnbg":"rgb(206, 60, 55)","btnbgh":"rgb(131, 35, 32)","btncolor":"rgb(254, 254, 254)","btncolorh":"rgb(254, 254, 254)","footerbg":"rgb(29, 121, 137)","footercolor":"rgb(254, 254, 254)","fontSettings":1,"bodysize":"1","h1size":"2","h2size":"1.7","h3size":"1.5"}');
850850

851851
-- --------------------------------------------------------
852852

installation/sql/postgresql/base.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder",
419419
-- Templates
420420
INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES
421421
(0, 'atum', 'template', 'atum', '', 1, 1, 1, 0, 1, '', '', '', 0, 0),
422-
(0, 'cassiopeia', 'template', 'cassiopeia', '', 0, 1, 1, 0, 1, '', '{"brand":"1","logoFile":"","siteTitle":"","siteDescription":"","useFontScheme":"0","colorName":"colors_standard","fluidContainer":"0","stickyHeader":0,"backTop":0}', '', 0, 0);
422+
(0, 'cassiopeia', 'template', 'cassiopeia', '', 0, 1, 1, 0, 1, '', '{"brand":"1","logoFile":"","siteTitle":"","siteDescription":"","useFontScheme":"0","colorName":"colors_standard","fluidContainer":"0","stickyHeader":0,"backTop":0,"colorSettings":1,"headerbg":"rgb(193, 205, 207)","headercolor":"rgb(23, 23, 23)","bodybg":"rgb(254, 254, 254)","bodycolor":"rgb(23, 23, 23)","linkcolor":"rgb(29, 121, 137)","linkcolorh":"rgb(14, 59, 67)","btnbg":"rgb(206, 60, 55)","btnbgh":"rgb(131, 35, 32)","btncolor":"rgb(254, 254, 254)","btncolorh":"rgb(254, 254, 254)","footerbg":"rgb(29, 121, 137)","footercolor":"rgb(254, 254, 254)","fontSettings":1,"bodysize":"1","h1size":"2","h2size":"1.7","h3size":"1.5"}', '', 0, 0);
423423

424424
-- Files Extensions
425425
INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES
@@ -861,7 +861,7 @@ CREATE INDEX "#__template_styles_idx_client_id_home" ON "#__template_styles" ("c
861861
--
862862
INSERT INTO "#__template_styles" ("id", "template", "client_id", "home", "title", "inheritable", "parent", "params") VALUES
863863
(10, 'atum', 1, '1', 'Atum - Default', 1, '', '{"hue":"hsl(214, 63%, 20%)","bg-light":"#f0f4fb","text-dark":"#495057","text-light":"#ffffff","link-color":"#2a69b8","special-color":"#001b4c","colorScheme":"os","monochrome":"0","loginLogo":"","loginLogoAlt":"","logoBrandLarge":"","logoBrandLargeAlt":"","logoBrandSmall":"","logoBrandSmallAlt":""}'),
864-
(11, 'cassiopeia', 0, '1', 'Cassiopeia - Default', 1, '', '{"brand":"1","logoFile":"","siteTitle":"","siteDescription":"","useFontScheme":"0","colorName":"colors_standard","fluidContainer":"0","stickyHeader":0,"backTop":0}');
864+
(11, 'cassiopeia', 0, '1', 'Cassiopeia - Default', 1, '', '{"brand":"1","logoFile":"","siteTitle":"","siteDescription":"","useFontScheme":"0","colorName":"colors_standard","fluidContainer":"0","stickyHeader":0,"backTop":0,"colorSettings":1,"headerbg":"rgb(193, 205, 207)","headercolor":"rgb(23, 23, 23)","bodybg":"rgb(254, 254, 254)","bodycolor":"rgb(23, 23, 23)","linkcolor":"rgb(29, 121, 137)","linkcolorh":"rgb(14, 59, 67)","btnbg":"rgb(206, 60, 55)","btnbgh":"rgb(131, 35, 32)","btncolor":"rgb(254, 254, 254)","btncolorh":"rgb(254, 254, 254)","footerbg":"rgb(29, 121, 137)","footercolor":"rgb(254, 254, 254)","fontSettings":1,"bodysize":"1","h1size":"2","h2size":"1.7","h3size":"1.5"}');
865865

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

language/en-GB/tpl_cassiopeia.ini

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,30 @@
44
; Note : All ini files need to be saved as UTF-8
55

66
CASSIOPEIA="Cassiopeia Site template"
7+
COM_TEMPLATES_COLORS_FIELDSET_LABEL="Advanced Colour Settings"
8+
COM_TEMPLATES_SIZES_FIELDSET_LABEL="Advanced Font Settings"
79
TPL_CASSIOPEIA_BACKTOTOP="Back to Top"
810
TPL_CASSIOPEIA_BACKTOTOP_LABEL="Back-to-top Link"
11+
TPL_CASSIOPEIA_BODY_BACKGROUND_COLOR_LABEL="Body Background Colour"
12+
TPL_CASSIOPEIA_BODY_SIZE="Body Font Size (rem)"
13+
TPL_CASSIOPEIA_BODY_TEXT_COLOR_LABEL="Body Text Colour"
914
TPL_CASSIOPEIA_BRAND_LABEL="Brand"
15+
TPL_CASSIOPEIA_BUTTON_BACKGROUND_COLOR_LABEL="Button Primary Background Colour"
16+
TPL_CASSIOPEIA_BUTTON_BACKGROUND_HOVER_COLOR_LABEL="Button Primary Hover Background Colour"
17+
TPL_CASSIOPEIA_BUTTON_COLOR_LABEL="Button Primary Text Colour"
18+
TPL_CASSIOPEIA_BUTTON_HOVER_COLOR_LABEL="Button Primary Hover Text Colour"
1019
TPL_CASSIOPEIA_COLOR_NAME_ALTERNATIVE="Alternative"
20+
TPL_CASSIOPEIA_COLOR_NAME_CUSTOM="Custom"
1121
TPL_CASSIOPEIA_COLOR_NAME_LABEL="Colour Theme"
1222
TPL_CASSIOPEIA_COLOR_NAME_STANDARD="Standard"
23+
TPL_CASSIOPEIA_COLORS_LABEL="Enable Advanced Colour Settings"
1324
TPL_CASSIOPEIA_FLUID="Fluid"
1425
TPL_CASSIOPEIA_FLUID_LABEL="Layout"
1526
TPL_CASSIOPEIA_FONT_GROUP_LOCAL="Fonts from Folder"
1627
TPL_CASSIOPEIA_FONT_GROUP_WEB="Fonts from Web"
1728
TPL_CASSIOPEIA_FONT_LABEL="Fonts Scheme"
1829
TPL_CASSIOPEIA_FONT_NOTE_TEXT="System fonts are the most performant although there may be small differences between operating systems.<br>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."
30+
TPL_CASSIOPEIA_FONT_SIZES_LABEL="Enable Advanced Font Settings"
1931
TPL_CASSIOPEIA_FONT_SYSTEM="System Fonts"
2032
TPL_CASSIOPEIA_FONT_SYSTEM_BODY="Body Font Stack"
2133
TPL_CASSIOPEIA_FONT_SYSTEM_HEADING="Heading Font Stack"
@@ -34,10 +46,20 @@ TPL_CASSIOPEIA_FONT_SYSTEM_STACK_SYSTEM_OLDSTYLE="Old Style"
3446
TPL_CASSIOPEIA_FONT_SYSTEM_STACK_SYSTEM_ROUNDED="Rounded Sans"
3547
TPL_CASSIOPEIA_FONT_SYSTEM_STACK_SYSTEM_SLAB="Slab Serif"
3648
TPL_CASSIOPEIA_FONT_SYSTEM_STACK_SYSTEM_TRANSITIONAL="Transitional"
49+
TPL_CASSIOPEIA_FOOTER_BACKGROUND_COLOR_LABEL="Footer Background Colour"
50+
TPL_CASSIOPEIA_FOOTER_TEXT_COLOR_LABEL="Footer Text Colour"
51+
TPL_CASSIOPEIA_H1_SIZE="H1 Font Size (rem)"
52+
TPL_CASSIOPEIA_H2_SIZE="H2 Font Size (rem)"
53+
TPL_CASSIOPEIA_H3_SIZE="H3 Font Size (rem)"
54+
TPL_CASSIOPEIA_HEADER_BACKGROUND_COLOR_LABEL="Header Background Colour"
55+
TPL_CASSIOPEIA_HEADER_TEXT_COLOR_LABEL="Header Text Colour"
56+
TPL_CASSIOPEIA_LINK_COLOR_LABEL="Links Colour"
57+
TPL_CASSIOPEIA_LINK_HOVER_COLOR_LABEL="Links Hover Colour"
3758
TPL_CASSIOPEIA_LOGO_LABEL="Logo"
3859
TPL_CASSIOPEIA_STATIC="Static"
3960
TPL_CASSIOPEIA_STICKY_LABEL="Sticky Header"
4061
TPL_CASSIOPEIA_TAGLINE_DESC="Optional text to show as a subheading"
4162
TPL_CASSIOPEIA_TAGLINE_LABEL="Tagline"
4263
TPL_CASSIOPEIA_TITLE="Title (alternative to logo)"
4364
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 site template based on Bootstrap 5."
65+

language/en-GB/tpl_cassiopeia.sys.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
; Note : All ini files need to be saved as UTF-8
55

66
CASSIOPEIA="Cassiopeia Site template"
7+
COM_TEMPLATES_COLORS_FIELDSET_LABEL="Advanced Colour Settings"
8+
COM_TEMPLATES_SIZES_FIELDSET_LABEL="Advanced Font Settings"
79
TPL_CASSIOPEIA_MOD_CUSTOM_LAYOUT_BANNER="Banner"
810
TPL_CASSIOPEIA_MOD_MENU_LAYOUT_COLLAPSE-METISMENU="Collapsible Dropdown"
911
TPL_CASSIOPEIA_MOD_MENU_LAYOUT_DROPDOWN-METISMENU="Dropdown"

templates/cassiopeia/component.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,39 @@
6565
// Override 'template.active' asset to set correct ltr/rtl dependency
6666
$wa->registerStyle('template.active', '', [], [], ['template.cassiopeia.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')]);
6767

68+
// Advanced Color Settings
69+
$paramsColorSettings = $this->params->get('colorSettings', false);
70+
71+
if ($paramsColorSettings) {
72+
$wa->registerAndUseStyle('colors_custom', 'global/' . 'colors_custom.css')
73+
->addInlineStyle(':root {
74+
--body-bg: ' . $this->params->get('bodybg') . ';
75+
--body-color: ' . $this->params->get('bodycolor') . ';
76+
--btnbg: ' . $this->params->get('btnbg') . ';
77+
--btnbgh: ' . $this->params->get('btnbgh') . ';
78+
--btncolor: ' . $this->params->get('btncolor') . ';
79+
--btncolorh: ' . $this->params->get('btncolorh') . ';
80+
--footerbg: ' . $this->params->get('footerbg') . ';
81+
--footercolor: ' . $this->params->get('footercolor') . ';
82+
--headerbg: ' . $this->params->get('headerbg') . ';
83+
--headercolor: ' . $this->params->get('headercolor') . ';
84+
--link-color: ' . $this->params->get('linkcolor') . ';
85+
--link-hover-color: ' . $this->params->get('linkcolorh') . ';
86+
}');
87+
}
88+
89+
// Advanced Font Settings
90+
$paramsFontSettings = $this->params->get('fontSettings', false);
91+
92+
if ($paramsFontSettings) {
93+
$wa->addInlineStyle(':root {
94+
--body-font-size: ' . $this->params->get('bodysize') . 'rem;
95+
--h1size: ' . $this->params->get('h1size') . 'rem;
96+
--h2size: ' . $this->params->get('h2size') . 'rem;
97+
--h3size: ' . $this->params->get('h3size') . 'rem;
98+
}');
99+
}
100+
68101
// Browsers support SVG favicons
69102
$this->addHeadLink(HTMLHelper::_('image', 'joomla-favicon.svg', '', [], true, 1), 'icon', 'rel', ['type' => 'image/svg+xml']);
70103
$this->addHeadLink(HTMLHelper::_('image', 'favicon.ico', '', [], true, 1), 'alternate icon', 'rel', ['type' => 'image/vnd.microsoft.icon']);

templates/cassiopeia/error.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,39 @@
7777
// Override 'template.active' asset to set correct ltr/rtl dependency
7878
$wa->registerStyle('template.active', '', [], [], ['template.cassiopeia.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')]);
7979

80+
// Advanced Color Settings
81+
$paramsColorSettings = $this->params->get('colorSettings', false);
82+
83+
if ($paramsColorSettings) {
84+
$wa->registerAndUseStyle('colors_custom', 'global/' . 'colors_custom.css')
85+
->addInlineStyle(':root {
86+
--body-bg: ' . $this->params->get('bodybg') . ';
87+
--body-color: ' . $this->params->get('bodycolor') . ';
88+
--btnbg: ' . $this->params->get('btnbg') . ';
89+
--btnbgh: ' . $this->params->get('btnbgh') . ';
90+
--btncolor: ' . $this->params->get('btncolor') . ';
91+
--btncolorh: ' . $this->params->get('btncolorh') . ';
92+
--footerbg: ' . $this->params->get('footerbg') . ';
93+
--footercolor: ' . $this->params->get('footercolor') . ';
94+
--headerbg: ' . $this->params->get('headerbg') . ';
95+
--headercolor: ' . $this->params->get('headercolor') . ';
96+
--link-color: ' . $this->params->get('linkcolor') . ';
97+
--link-hover-color: ' . $this->params->get('linkcolorh') . ';
98+
}');
99+
}
100+
101+
// Advanced Font Settings
102+
$paramsFontSettings = $this->params->get('fontSettings', false);
103+
104+
if ($paramsFontSettings) {
105+
$wa->addInlineStyle(':root {
106+
--body-font-size: ' . $this->params->get('bodysize') . 'rem;
107+
--h1size: ' . $this->params->get('h1size') . 'rem;
108+
--h2size: ' . $this->params->get('h2size') . 'rem;
109+
--h3size: ' . $this->params->get('h3size') . 'rem;
110+
}');
111+
}
112+
80113
// Browsers support SVG favicons
81114
$this->addHeadLink(HTMLHelper::_('image', 'joomla-favicon.svg', '', [], true, 1), 'icon', 'rel', ['type' => 'image/svg+xml']);
82115
$this->addHeadLink(HTMLHelper::_('image', 'favicon.ico', '', [], true, 1), 'alternate icon', 'rel', ['type' => 'image/vnd.microsoft.icon']);

templates/cassiopeia/index.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,40 @@
9494
// Override 'template.active' asset to set correct ltr/rtl dependency
9595
$wa->registerStyle('template.active', '', [], [], ['template.cassiopeia.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')]);
9696

97+
// Advanced Color Settings
98+
$paramsColorSettings = $this->params->get('colorSettings', false);
99+
100+
if ($paramsColorSettings) {
101+
$wa->registerAndUseStyle('colors_custom', 'global/' . 'colors_custom.css')
102+
->addInlineStyle(':root {
103+
--body-bg: ' . $this->params->get('bodybg') . ';
104+
--body-color: ' . $this->params->get('bodycolor') . ';
105+
--btnbg: ' . $this->params->get('btnbg') . ';
106+
--btnbgh: ' . $this->params->get('btnbgh') . ';
107+
--btncolor: ' . $this->params->get('btncolor') . ';
108+
--btncolorh: ' . $this->params->get('btncolorh') . ';
109+
--footerbg: ' . $this->params->get('footerbg') . ';
110+
--footercolor: ' . $this->params->get('footercolor') . ';
111+
--headerbg: ' . $this->params->get('headerbg') . ';
112+
--headercolor: ' . $this->params->get('headercolor') . ';
113+
--link-color: ' . $this->params->get('linkcolor') . ';
114+
--link-hover-color: ' . $this->params->get('linkcolorh') . ';
115+
}');
116+
}
117+
118+
// Advanced Font Settings
119+
$paramsFontSettings = $this->params->get('fontSettings', false);
120+
121+
if ($paramsFontSettings) {
122+
$wa->registerAndUseStyle('font_advanced', 'global/' . 'font_advanced.css')
123+
->addInlineStyle(':root {
124+
--body-font-size: ' . $this->params->get('bodysize') . 'rem;
125+
--h1size: ' . $this->params->get('h1size') . 'rem;
126+
--h2size: ' . $this->params->get('h2size') . 'rem;
127+
--h3size: ' . $this->params->get('h3size') . 'rem;
128+
}');
129+
}
130+
97131
// Logo file or site title param
98132
if ($this->params->get('logoFile')) {
99133
$logo = HTMLHelper::_('image', Uri::root(false) . htmlspecialchars($this->params->get('logoFile'), ENT_QUOTES), $sitename, ['loading' => 'eager', 'decoding' => 'async'], false, 0);

templates/cassiopeia/offline.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,39 @@
7272
// Override 'template.active' asset to set correct ltr/rtl dependency
7373
$wa->registerStyle('template.active', '', [], [], ['template.cassiopeia.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')]);
7474

75+
// Advanced Color Settings
76+
$paramsColorSettings = $this->params->get('colorSettings', false);
77+
78+
if ($paramsColorSettings) {
79+
$wa->registerAndUseStyle('colors_custom', 'global/' . 'colors_custom.css')
80+
->addInlineStyle(':root {
81+
--body-bg: ' . $this->params->get('bodybg') . ';
82+
--body-color: ' . $this->params->get('bodycolor') . ';
83+
--btnbg: ' . $this->params->get('btnbg') . ';
84+
--btnbgh: ' . $this->params->get('btnbgh') . ';
85+
--btncolor: ' . $this->params->get('btncolor') . ';
86+
--btncolorh: ' . $this->params->get('btncolorh') . ';
87+
--footerbg: ' . $this->params->get('footerbg') . ';
88+
--footercolor: ' . $this->params->get('footercolor') . ';
89+
--headerbg: ' . $this->params->get('headerbg') . ';
90+
--headercolor: ' . $this->params->get('headercolor') . ';
91+
--link-color: ' . $this->params->get('linkcolor') . ';
92+
--link-hover-color: ' . $this->params->get('linkcolorh') . ';
93+
}');
94+
}
95+
96+
// Advanced Font Settings
97+
$paramsFontSettings = $this->params->get('fontSettings', false);
98+
99+
if ($paramsFontSettings) {
100+
$wa->addInlineStyle(':root {
101+
--body-font-size: ' . $this->params->get('bodysize') . 'rem;
102+
--h1size: ' . $this->params->get('h1size') . 'rem;
103+
--h2size: ' . $this->params->get('h2size') . 'rem;
104+
--h3size: ' . $this->params->get('h3size') . 'rem;
105+
}');
106+
}
107+
75108
// Logo file or site title param
76109
$sitename = htmlspecialchars($app->get('sitename'), ENT_QUOTES, 'UTF-8');
77110

0 commit comments

Comments
 (0)