Skip to content

a11y: aria-label on ThemeToggle does not reflect current theme #8044

@ShubhamOulkar

Description

@ShubhamOulkar

URL:

https://nodejs.org/en

Browser Name:

FF

Browser Version:

141

Operating System:

Windows 11

Description

While writing tests for the ThemeToggle component, I discovered that the aria-label attribute remains static ("Toggle Dark Mode") and does not reflect the current theme. This is an accessibility issue.

Image

This label does not change even after toggling the theme. As a result, screen reader users are not informed of the action the button will perform, which violates WCAG 4.1.2 (Name, Role, Value).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions