Changes before error encountered

Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-08 00:24:05 +00:00
parent af1f18e720
commit eb5f718039
5 changed files with 31 additions and 45 deletions

View File

@@ -33,9 +33,9 @@ $document = $app->getDocument();
$wa = $document->getWebAssetManager();
// Template params
$params_LightColorName = (string) $this->params->get('colorLightName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
$params_LightColorName = (string) $this->params->get('colorLightName', 'standard'); // standard|alternative|custom
$params_DarkColorName = (string) $this->params->get('colorDarkName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
$params_DarkColorName = (string) $this->params->get('colorDarkName', 'standard'); // standard|alternative|custom
$params_googletagmanager = $this->params->get('googletagmanager', false);
$params_googletagmanagerid = $this->params->get('googletagmanagerid', null);

View File

@@ -29,9 +29,9 @@ $params = $this->params;
$wa = $this->getWebAssetManager();
// Template params
$params_LightColorName = (string) $params->get('colorLightName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
$params_LightColorName = (string) $params->get('colorLightName', 'standard'); // standard|alternative|custom
$params_DarkColorName = (string) $params->get('colorDarkName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
$params_DarkColorName = (string) $params->get('colorDarkName', 'standard'); // standard|alternative|custom
$params_googletagmanager = $params->get('googletagmanager', false);
$params_googletagmanagerid = $params->get('googletagmanagerid', '');
@@ -66,14 +66,14 @@ $colorDarkKey = strtolower(preg_replace('/[^a-z0-9_.-]/i', '', $params_DarkColo
$lightKey = 'template.light.' . $colorLightKey;
$darkKey = 'template.dark.' . $colorDarkKey;
try {
$wa->useStyle('template.light.colors_standard');
$wa->useStyle('template.light.standard');
} catch (\Throwable $e) {
$wa->registerAndUseStyle('template.light.colors_standard', $templatePath . '/css/theme/light.standard.css');
$wa->registerAndUseStyle('template.light.standard', $templatePath . '/css/theme/light.standard.css');
}
try {
$wa->useStyle('template.dark.colors_standard');
$wa->useStyle('template.dark.standard');
} catch (\Throwable $e) {
$wa->registerAndUseStyle('template.dark.colors_standard', $templatePath . '/css/theme/dark.standard.css');
$wa->registerAndUseStyle('template.dark.standard', $templatePath . '/css/theme/dark.standard.css');
}
try {
$wa->useStyle($lightKey);

View File

@@ -45,9 +45,9 @@ $document = $app->getDocument();
$wa = $document->getWebAssetManager();
// Template params
$params_LightColorName = (string) $this->params->get('colorLightName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
$params_LightColorName = (string) $this->params->get('colorLightName', 'standard'); // standard|alternative|custom
$params_DarkColorName = (string) $this->params->get('colorDarkName', 'colors_standard'); // colors_standard|colors_alternative|colors_custom
$params_DarkColorName = (string) $this->params->get('colorDarkName', 'standard'); // standard|alternative|custom
$params_googletagmanager = $this->params->get('googletagmanager', false);
$params_googletagmanagerid = $this->params->get('googletagmanagerid', null);
@@ -88,34 +88,20 @@ $templatePath = 'media/templates/site/mokocassiopeia';
// Core template CSS
$wa->useStyle('template.base'); // css/template.css
// Color theme (light + optional dark)
$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;
// Theme palettes (light + dark)
// Always load standard theme, then load custom if selected
$wa->useStyle('template.light.standard');
$wa->useStyle('template.dark.standard');
try {
$wa->useStyle('template.light.colors_standard');
} catch (\Throwable $e) {
$wa->registerAndUseStyle('template.light.colors_standard', $templatePath . '/css/theme/light.standard.css');
// Load custom or alternative themes if selected
if ($params_LightColorName === 'custom') {
$wa->useStyle('template.light.custom');
}
try {
$wa->useStyle('template.dark.colors_standard');
} catch (\Throwable $e) {
$wa->registerAndUseStyle('template.dark.colors_standard', $templatePath . '/css/theme/dark.standard.css');
}
try {
$wa->useStyle($lightKey);
} catch (\Throwable $e) {
$wa->registerAndUseStyle('template.light.dynamic', $templatePath . '/css/theme/light.' . $colorLightKey . '.css');
}
try {
$wa->useStyle($darkKey);
} catch (\Throwable $e) {
$wa->registerAndUseStyle('template.dark.dynamic', $templatePath . '/css/theme/dark.' . $colorDarkKey . '.css');
if ($params_DarkColorName === 'custom') {
$wa->useStyle('template.dark.custom');
} elseif ($params_DarkColorName === 'alternative') {
$wa->useStyle('template.dark.alternative');
}
// Scripts

View File

@@ -65,13 +65,13 @@
"attributes": {"media": "all"}
},
{
"name": "template.light.colors_standard",
"name": "template.light.standard",
"type": "style",
"uri": "media/templates/site/mokocassiopeia/css/theme/light.standard.css",
"attributes": {"media": "all"}
},
{
"name": "template.light.colors_standard.min",
"name": "template.light.standard.min",
"type": "style",
"uri": "media/templates/site/mokocassiopeia/css/theme/light.standard.min.css",
"attributes": {"media": "all"}
@@ -89,13 +89,13 @@
"attributes": {"media": "all"}
},
{
"name": "template.dark.colors_standard",
"name": "template.dark.standard",
"type": "style",
"uri": "media/templates/site/mokocassiopeia/css/theme/dark.standard.css",
"attributes": {"media": "all"}
},
{
"name": "template.dark.colors_standard.min",
"name": "template.dark.standard.min",
"type": "style",
"uri": "media/templates/site/mokocassiopeia/css/theme/dark.standard.min.css",
"attributes": {"media": "all"}

View File

@@ -187,13 +187,13 @@
<!-- Variables & Palettes -->
<field name="theme_sep_vars" type="spacer" label="Variables &amp; Palettes" hr="false" class="text fw-bold" />
<field name="colorLightName" type="list" label="TPL_MOKOCASSIOPEIA_COLOR_LIGHT_NAME_LABEL" hint="TPL_MOKOCASSIOPEIA_COLOR_LIGHT_NAME_DESC" default="colors_standard">
<option value="colors_standard">TPL_MOKOCASSIOPEIA_COLOR_NAME_STANDARD</option>
<option value="colors_custom">TPL_MOKOCASSIOPEIA_COLOR_NAME_CUSTOM</option>
<field name="colorLightName" type="list" label="TPL_MOKOCASSIOPEIA_COLOR_LIGHT_NAME_LABEL" hint="TPL_MOKOCASSIOPEIA_COLOR_LIGHT_NAME_DESC" default="standard">
<option value="standard">TPL_MOKOCASSIOPEIA_COLOR_NAME_STANDARD</option>
<option value="custom">TPL_MOKOCASSIOPEIA_COLOR_NAME_CUSTOM</option>
</field>
<field name="colorDarkName" type="list" label="TPL_MOKOCASSIOPEIA_COLOR_DARK_NAME_LABEL" hint="TPL_MOKOCASSIOPEIA_COLOR_DARK_NAME_DESC" default="colors_standard">
<option value="colors_standard">TPL_MOKOCASSIOPEIA_COLOR_NAME_STANDARD</option>
<option value="colors_custom">TPL_MOKOCASSIOPEIA_COLOR_NAME_CUSTOM</option>
<field name="colorDarkName" type="list" label="TPL_MOKOCASSIOPEIA_COLOR_DARK_NAME_LABEL" hint="TPL_MOKOCASSIOPEIA_COLOR_DARK_NAME_DESC" default="standard">
<option value="standard">TPL_MOKOCASSIOPEIA_COLOR_NAME_STANDARD</option>
<option value="custom">TPL_MOKOCASSIOPEIA_COLOR_NAME_CUSTOM</option>
</field>
<!-- Typography -->