Skip to content

Light/dark mode toggle icon is reversed #11370

Description

@informatix8

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

The light/dark mode toggle icon is reversed. When in light mode, it should display a moon icon with the HTML title "Switch to dark mode"—indicating the result of clicking—rather than representing the current state.

This aligns with standard UX conventions where:

  • The icon always reflects the target state (what you’ll get after clicking)
  • The HTML title describes the action ("Switch to...") instead of the current mode

Reproducible demo

No response

Steps to reproduce

Standard installation

Expected behavior

  • When in light mode, the mode button should display a moon icon.
  • When in dark mode, the mode button should display the sun icon.

Actual behavior

  • When in light mode, the mode button displays the sun icon.
  • When in dark mode, the mode button displays the moon icon.

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executionclosed: wontfixA fix will bring significant overhead, or is out of scope (for feature requests)

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions