fix: submenu icons not rendering in Joomla 6
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 2s
Universal: Auto Version Bump / Version Bump (push) Successful in 14s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 15s
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled

The CSS selector #menu doesn't exist in Joomla 6 — mod_menu uses
id="menu{moduleId}" (dynamic). Switch to .main-nav class selector
which is stable across Joomla 4/5/6. Also use margin-inline-end
for RTL support.
This commit is contained in:
Jonathan Miller
2026-06-11 22:14:39 -05:00
parent e93a25c9d2
commit 7ba0468907
@@ -30,13 +30,13 @@ class MokoSuiteBackupComponent extends MVCComponent
$wa = $app->getDocument()->getWebAssetManager();
$wa->addInlineStyle(
'#menu a[href*="com_mokosuitebackup"][href*="view=dashboard"] .sidebar-item-title::before,'
. ' #menu a[href*="com_mokosuitebackup"][href*="view=backups"] .sidebar-item-title::before,'
. ' #menu a[href*="com_mokosuitebackup"][href*="view=profiles"] .sidebar-item-title::before'
. ' { font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: .5em; }'
. ' #menu a[href*="com_mokosuitebackup"][href*="view=dashboard"] .sidebar-item-title::before { content: "\f015"; }'
. ' #menu a[href*="com_mokosuitebackup"][href*="view=backups"] .sidebar-item-title::before { content: "\f1c0"; }'
. ' #menu a[href*="com_mokosuitebackup"][href*="view=profiles"] .sidebar-item-title::before { content: "\f013"; }'
'.main-nav a[href*="com_mokosuitebackup"][href*="view=dashboard"] .sidebar-item-title::before,'
. ' .main-nav a[href*="com_mokosuitebackup"][href*="view=backups"] .sidebar-item-title::before,'
. ' .main-nav a[href*="com_mokosuitebackup"][href*="view=profiles"] .sidebar-item-title::before'
. ' { font-family: "Font Awesome 6 Free"; font-weight: 900; margin-inline-end: .5em; }'
. ' .main-nav a[href*="com_mokosuitebackup"][href*="view=dashboard"] .sidebar-item-title::before { content: "\f015"; }'
. ' .main-nav a[href*="com_mokosuitebackup"][href*="view=backups"] .sidebar-item-title::before { content: "\f1c0"; }'
. ' .main-nav a[href*="com_mokosuitebackup"][href*="view=profiles"] .sidebar-item-title::before { content: "\f013"; }'
);
} catch (\Throwable $e) {
error_log('MokoSuiteBackup: boot() CSS injection failed: ' . $e->getMessage());