EU Parliament Monitor โ€” API Documentation - v0.9.2
    Preparing search index...

    Function createThemeToggleButton

    • Generate theme toggle HTML button markup with a localized aria-label. Renders a moon (lightโ†’dark) and sun (darkโ†’light) icon as crisp inline SVGs (with currentColor) so the icon renders identically across platforms โ€” emoji rendering varies wildly between OSes. The legacy emoji <span>s remain as a low-priority fallback for environments where SVG is suppressed or stylesheets fail to load.

      The button announces its current state via aria-pressed so screen readers describe it as a toggle rather than a generic action button.

      Parameters

      • ariaLabel: string

        Localized accessible label for the theme toggle button

      Returns string

      HTML string for the theme toggle button