Files
Plenario/templates/element/theme_switch.php
T
gnilebeinandClaude Opus 5.5 1cb439de18
CI / Deploy / test (push) Successful in 45s
CI / Deploy / deploy (push) Skipped
Enlarge participant headings and make theme switch icon-only
The slide heading on the participant page was smaller than a regular h1
on phones. The theme switch now shows only its icon; the current and
next scheme stay available as aria-label and tooltip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 16:48:59 +01:00

26 lines
1.2 KiB
PHP

<?php
/**
* Icon-only button that cycles the colour scheme (wired up by webroot/js/plenario.js `Theme`);
* the current and next scheme are in aria-label and title.
* Without JavaScript it stays hidden, the system setting applies.
*
* @var \App\View\AppView $this
* @var string $key localStorage key, same as in element theme_init
* @var string $modes Comma separated cycle order of auto|light|dark
* @var string $class CSS class of the button
*/
$key ??= 'plenario-theme';
$modes ??= 'auto,light,dark';
$class ??= 'theme-switch';
?>
<button type="button" class="<?= h($class) ?>" data-theme-switch hidden
data-theme-key="<?= h($key) ?>" data-theme-modes="<?= h($modes) ?>"
data-label-auto="<?= __('Automatisch') ?>" data-label-light="<?= __('Hell') ?>" data-label-dark="<?= __('Dunkel') ?>"
data-label-prefix="<?= __('Farbschema') ?>" data-label-next="<?= __('wechseln zu') ?>"
<?= !empty($shortcut) ? 'aria-keyshortcuts="' . h($shortcut) . '"' : '' ?>>
<span class="theme-switch__icon" aria-hidden="true" data-theme-icon></span>
<?php if (!empty($shortcut)) : ?>
<kbd class="ctrl__key" aria-hidden="true">[<?= h($shortcut) ?>]</kbd>
<?php endif; ?>
</button>