dayjs
dayjs copied to clipboard
Feature Request: Add Theme Toggler to Documentation Site
Goals
- Introduce a Theme Toggler (Light/Dark mode) to enhance user accessibility and comfort.
- Improve the developer experience when browsing docs in different lighting conditions.
- Align with modern web UI standards and improve visual consistency.
Non-Goals
- No major redesign of the documentation layout.
- No change in content or documentation structure.
- 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).
@iamkun can i work on this and implement it on the website?