Files
chrnxandClaude Opus 5 a142ece51d feat: rebuild the header controls as icon buttons
The theme switch was three labelled radios that wrapped the header onto
a second line with long translations. It is three SVG buttons now, with
search and menu sharing the same language: no resting outline, a filled
chip for the active choice.

Radios gave arrow-key roving for free, so the group reimplements it
rather than losing it. The first chip colour put accent on accent and
failed WCAG AA; the label carries full contrast instead. Mobile targets
sit at 45px because a floor of exactly 44 rounds to 43.99997 in Firefox.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 19:41:24 -05:00

32 lines
947 B
PHP

<?php
/**
* Render the progressive mobile navigation toggle.
*
* @package CHRNX
*/
$chrnx_open_label = __( 'Open primary navigation', 'chrnx' );
$chrnx_close_label = __( 'Close primary navigation', 'chrnx' );
?>
<button
<?php
// WordPress escapes each generated wrapper attribute.
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo get_block_wrapper_attributes(
array(
'class' => 'chrnx-mobile-menu-toggle',
'data-chrnx-menu-toggle' => '',
)
);
?>
type="button"
hidden
aria-controls="chrnx-primary-navigation"
aria-expanded="false"
aria-label="<?php echo esc_attr( $chrnx_open_label ); ?>"
data-label-open="<?php echo esc_attr( $chrnx_open_label ); ?>"
data-label-close="<?php echo esc_attr( $chrnx_close_label ); ?>"
>
<?php echo chrnx_get_icon_markup( 'menu' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns a fixed literal SVG. ?>
</button>