Fixed style injection
This commit is contained in:
@@ -31,9 +31,7 @@
|
|||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
- Copyright Headers to MokoCodingDefaults standards
|
- Copyright Headers to MokoCodingDefaults standards
|
||||||
|
- Fixed `./templates/moko-cassiopeia/index.php` style injection
|
||||||
### Added
|
|
||||||
-
|
|
||||||
|
|
||||||
## [02.01.05] 2025-09-04
|
## [02.01.05] 2025-09-04
|
||||||
- Removed vmbasic.css
|
- Removed vmbasic.css
|
||||||
|
|||||||
@@ -35,7 +35,10 @@ $input = $app->getInput();
|
|||||||
$wa = $this->getWebAssetManager();
|
$wa = $this->getWebAssetManager();
|
||||||
|
|
||||||
// Template params
|
// Template params
|
||||||
$params_ColorName = (string) $this->params->get('colorName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
|
$params_LightColorName = (string) $this->params->get('colorLightName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
|
||||||
|
|
||||||
|
$params_DarkColorName = (string) $this->params->get('colorDarkName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
|
||||||
|
|
||||||
$params_googletagmanager = $this->params->get('googletagmanager', false);
|
$params_googletagmanager = $this->params->get('googletagmanager', false);
|
||||||
$params_googletagmanagerid = $this->params->get('googletagmanagerid', null);
|
$params_googletagmanagerid = $this->params->get('googletagmanagerid', null);
|
||||||
$params_googleanalytics = $this->params->get('googleanalytics', false);
|
$params_googleanalytics = $this->params->get('googleanalytics', false);
|
||||||
@@ -96,19 +99,21 @@ $wa->useStyle('template.user'); // css/user.css
|
|||||||
$wa->useStyle('vendor.bootstrap-toc');
|
$wa->useStyle('vendor.bootstrap-toc');
|
||||||
|
|
||||||
// Color theme (light + optional dark)
|
// Color theme (light + optional dark)
|
||||||
$colorKey = strtolower(preg_replace('/[^a-z0-9_.-]/i', '', $params_ColorName));
|
$colorLightKey = strtolower(preg_replace('/[^a-z0-9_.-]/i', '', $params_LightColorName));
|
||||||
$lightKey = 'template.light.' . $colorKey;
|
$colorDarkKey = strtolower(preg_replace('/[^a-z0-9_.-]/i', '', $params_DarkColorName));
|
||||||
$darkKey = 'template.dark.' . $colorKey;
|
|
||||||
|
$lightKey = 'template.light.' . $colorLightKey;
|
||||||
|
$darkKey = 'template.dark.' . $colorDarkKey;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$wa->useStyle($lightKey);
|
$wa->useStyle($lightKey);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$wa->registerAndUseStyle('template.light.dynamic', $templatePath . '/css/global/colors/light/' . $params_ColorName . '.css');
|
$wa->registerAndUseStyle('template.light.dynamic', $templatePath . '/css/global/light/' . $colorLightKey . '.css');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$wa->useStyle($darkKey);
|
$wa->useStyle($darkKey);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
// optional; omit if not present
|
$wa->registerAndUseStyle('template.dark.dynamic', $templatePath . '/css/global/dark/' . $colorDarkKey . '.css');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scripts
|
// Scripts
|
||||||
@@ -119,7 +124,7 @@ $wa->useScript('vendor.bootstrap-toc.js');
|
|||||||
|
|
||||||
// Font scheme (external or local) + CSS custom properties
|
// Font scheme (external or local) + CSS custom properties
|
||||||
$params_FontScheme = $this->params->get('useFontScheme', false);
|
$params_FontScheme = $this->params->get('useFontScheme', false);
|
||||||
$fontStyles = '';
|
$fontStyles = '';
|
||||||
|
|
||||||
if ($params_FontScheme) {
|
if ($params_FontScheme) {
|
||||||
if (stripos($params_FontScheme, 'https://') === 0) {
|
if (stripos($params_FontScheme, 'https://') === 0) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
|
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
|
||||||
"name": "tpl_moko-cassiopeia",
|
"name": "tpl_moko-cassiopeia",
|
||||||
"version": "02.01.05",
|
"version": "03.00-RC",
|
||||||
"description": "Moko-Cassiopeia template assets",
|
"description": "Moko-Cassiopeia template assets",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"x-header":
|
"x-header":
|
||||||
|
|||||||
Reference in New Issue
Block a user