dayjs icon indicating copy to clipboard operation
dayjs copied to clipboard

Feature Request: Add Theme Toggler to Documentation Site

Open KhanjarSingh opened this issue 1 month ago • 1 comments

Goals

  1. Introduce a Theme Toggler (Light/Dark mode) to enhance user accessibility and comfort.
  2. Improve the developer experience when browsing docs in different lighting conditions.
  3. Align with modern web UI standards and improve visual consistency.

Non-Goals

  1. No major redesign of the documentation layout.
  2. No change in content or documentation structure.
  3. No dependency on external theming frameworks unless required by the site’s tech stack.

Background

Currently, the Day.js documentation uses a static light theme, which can be uncomfortable during night-time browsing or long reading sessions.
Adding a theme toggler improves readability and follows best practices used by most modern documentation sites such as React, Next.js, and MDN.


Proposal

  • Add a Theme Toggle Button (e.g., 🌞 / 🌙) in the top-right corner of the navigation bar.
  • Store user preference using localStorage so that the chosen theme persists across sessions.
  • Support both Light and Dark themes using CSS variables or a small JS toggle script.
  • Optional: Detect system theme preference (prefers-color-scheme).

KhanjarSingh avatar Nov 11 '25 04:11 KhanjarSingh

@iamkun can i work on this and implement it on the website?

KhanjarSingh avatar Nov 11 '25 04:11 KhanjarSingh