From 5b08fe53b586eea4a9bc86a20a1b9fa25ac430b5 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 23 Apr 2026 23:10:02 +0000 Subject: [PATCH] feat: mod_custom background uses --hero-bg-image CSS variable Co-Authored-By: Claude Opus 4.6 (1M context) --- src/html/mod_custom/default.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/html/mod_custom/default.php b/src/html/mod_custom/default.php index 5e03a50..501c3b4 100644 --- a/src/html/mod_custom/default.php +++ b/src/html/mod_custom/default.php @@ -25,8 +25,9 @@ $headerClass = htmlspecialchars($params->get('header_class', ''), ENT_COMPAT, 'U if ($params->get('backgroundimage')) { /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $app->getDocument()->getWebAssetManager(); + $bgUrl = Uri::root(true) . '/' . HTMLHelper::_('cleanImageURL', $params->get('backgroundimage'))->url; $wa->addInlineStyle( - '#' . $modId . '{background-image: url("' . Uri::root(true) . '/' . HTMLHelper::_('cleanImageURL', $params->get('backgroundimage'))->url . '");}', + '#' . $modId . '{--hero-bg-image: url("' . $bgUrl . '"); background-image: var(--hero-bg-image);}', ['name' => $modId] ); }