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