Add theme switcher, a11y toolbar, and high-contrast CSS to offline page
Some checks failed
Repo Health / Access control (push) Failing after 1s
Repo Health / Release configuration (push) Has been skipped
Repo Health / Scripts governance (push) Has been skipped
Repo Health / Repository health (push) Has been skipped

- Load a11y-high-contrast.css via WAM
- Add all data-theme-fab-* and data-a11y-* attributes to body
- Theme switcher FAB and a11y toolbar now render on offline page

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-04-16 18:41:22 -05:00
parent 6708569c6f
commit a62d405077

View File

@@ -65,7 +65,10 @@ if ($params_DarkColorName === 'custom' && file_exists(JPATH_ROOT . '/media/templ
// User overrides (loaded last)
$wa->useStyle('template.user');
// Template JS (theme switcher, var-copy, etc.)
// Accessibility high-contrast stylesheet
$wa->useStyle('template.a11y-high-contrast');
// Template JS (theme switcher, a11y toolbar, var-copy, etc.)
if ($params_developmentmode) {
$wa->useScript('template.js');
} else {
@@ -149,7 +152,19 @@ if ($params_favicon_source) {
}
// Theme params
$params_theme_enabled = (int) $params->get('theme_enabled', 1);
$params_theme_enabled = (int) $params->get('theme_enabled', 1);
$params_theme_fab_enabled = (int) $params->get('theme_fab_enabled', 1);
$params_theme_fab_pos = 'br';
// Accessibility params
$params_a11y_toolbar = (int) $params->get('a11y_toolbar_enabled', 1);
$params_a11y_resize = (int) $params->get('a11y_text_resize', 1);
$params_a11y_invert = (int) $params->get('a11y_color_inversion', 1);
$params_a11y_contrast = (int) $params->get('a11y_high_contrast', 1);
$params_a11y_links = (int) $params->get('a11y_highlight_links', 1);
$params_a11y_font = (int) $params->get('a11y_readable_font', 1);
$params_a11y_animations = (int) $params->get('a11y_pause_animations', 1);
$params_a11y_pos = 'br';
// Analytics params
$params_googletagmanager = $params->get('googletagmanager', false);
@@ -203,7 +218,18 @@ if (class_exists('\Joomla\Component\Users\Site\Helper\RouteHelper')) {
<?php endif; ?>
</head>
<body class="site moko-offline-wrap" <?php if ($bgStyle) : ?>style="<?php echo $bgStyle; ?>"<?php endif; ?>>
<body class="site moko-offline-wrap"
data-theme-fab-enabled="<?php echo $params_theme_fab_enabled ? '1' : '0'; ?>"
data-theme-fab-pos="<?php echo htmlspecialchars($params_theme_fab_pos, ENT_QUOTES, 'UTF-8'); ?>"
data-a11y-toolbar="<?php echo $params_a11y_toolbar ? '1' : '0'; ?>"
data-a11y-resize="<?php echo $params_a11y_resize ? '1' : '0'; ?>"
data-a11y-invert="<?php echo $params_a11y_invert ? '1' : '0'; ?>"
data-a11y-contrast="<?php echo $params_a11y_contrast ? '1' : '0'; ?>"
data-a11y-links="<?php echo $params_a11y_links ? '1' : '0'; ?>"
data-a11y-font="<?php echo $params_a11y_font ? '1' : '0'; ?>"
data-a11y-animations="<?php echo $params_a11y_animations ? '1' : '0'; ?>"
data-a11y-pos="<?php echo htmlspecialchars($params_a11y_pos, ENT_QUOTES, 'UTF-8'); ?>"
<?php if ($bgStyle) : ?>style="<?php echo $bgStyle; ?>"<?php endif; ?>>
<?php if (!empty($params_googletagmanager) && !empty($params_googletagmanagerid)) :
$gtmID = htmlspecialchars($params_googletagmanagerid, ENT_QUOTES, 'UTF-8'); ?>
<script>