[PR #5007] [MERGED] feat: dedicated dark theme option with system preference support #4857

Closed
opened 2026-02-22 18:36:40 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/5007
Author: @angelplusultra
Created: 2/17/2026
Status: Merged
Merged: 2/19/2026
Merged by: @timothycarambat

Base: masterHead: 4991-feat-dedicated-dark-theme-option


📝 Commits (5)

  • 7d96182 implement OS level theme switching and dark mode option
  • 4c5ca00 simplify
  • 869c0c0 fix logo bug in login | place back useTheme comment
  • 43cb110 Merge branch 'master' into 4991-feat-dedicated-dark-theme-option
  • e66c31b Merge branch 'master' into 4991-feat-dedicated-dark-theme-option

📊 Changes

2 files changed (+34 additions, -22 deletions)

View changed files

📝 frontend/src/LogoContext.jsx (+9 -10)
📝 frontend/src/hooks/useTheme.js (+25 -12)

📄 Description

Pull Request Type

  • feat

Relevant Issues

resolves #4991

What is in this change?

https://github.com/user-attachments/assets/daa7639f-e8b6-4784-b79b-2e538983abd4

Refactors the theme system from two options (Default/Light) to three: System, Light, and Dark.

  • System — follows the OS preference and reacts live to changes (e.g. macOS auto dark mode)
  • Light — forces light mode
  • Dark — forces dark mode

Previously, OS preference was only checked once on first load and then locked to localStorage. Now "System" mode continuously listens via matchMedia for OS-level changes.

Also fixes LogoContext to check the resolved data-theme attribute instead of comparing raw localStorage values, which broke logo colors after the rename from "default" to "dark".

Legacy "default" values in localStorage are automatically migrated to "dark".

Additional Information

Only two files changed — useTheme.js and LogoContext.jsx. No CSS, tailwind config, or component changes needed since ThemePreference already renders dynamically from availableThemes and the CSS variable system ([data-theme="light"] override on :root) works with any non-"light" data-theme value.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/5007 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 2/17/2026 **Status:** ✅ Merged **Merged:** 2/19/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `4991-feat-dedicated-dark-theme-option` --- ### 📝 Commits (5) - [`7d96182`](https://github.com/Mintplex-Labs/anything-llm/commit/7d961829d5b29c90ce8053057d17c9de681a45ae) implement OS level theme switching and dark mode option - [`4c5ca00`](https://github.com/Mintplex-Labs/anything-llm/commit/4c5ca0051f3fff0ab9ba9c385462123d71ec7d54) simplify - [`869c0c0`](https://github.com/Mintplex-Labs/anything-llm/commit/869c0c0c42cd4fe58965cae302656b50c0cb2ae1) fix logo bug in login | place back useTheme comment - [`43cb110`](https://github.com/Mintplex-Labs/anything-llm/commit/43cb1105d413963e0f31950384c102dda418cb46) Merge branch 'master' into 4991-feat-dedicated-dark-theme-option - [`e66c31b`](https://github.com/Mintplex-Labs/anything-llm/commit/e66c31b2b5e9981dcecc1cb85ad81b5e743fab0d) Merge branch 'master' into 4991-feat-dedicated-dark-theme-option ### 📊 Changes **2 files changed** (+34 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/LogoContext.jsx` (+9 -10) 📝 `frontend/src/hooks/useTheme.js` (+25 -12) </details> ### 📄 Description ### Pull Request Type - [x] ✨ feat ### Relevant Issues resolves #4991 ### What is in this change? https://github.com/user-attachments/assets/daa7639f-e8b6-4784-b79b-2e538983abd4 Refactors the theme system from two options (Default/Light) to three: **System**, **Light**, and **Dark**. - **System** — follows the OS preference and reacts live to changes (e.g. macOS auto dark mode) - **Light** — forces light mode - **Dark** — forces dark mode Previously, OS preference was only checked once on first load and then locked to localStorage. Now "System" mode continuously listens via `matchMedia` for OS-level changes. Also fixes `LogoContext` to check the resolved `data-theme` attribute instead of comparing raw localStorage values, which broke logo colors after the rename from `"default"` to `"dark"`. Legacy `"default"` values in localStorage are automatically migrated to `"dark"`. ### Additional Information Only two files changed — `useTheme.js` and `LogoContext.jsx`. No CSS, tailwind config, or component changes needed since `ThemePreference` already renders dynamically from `availableThemes` and the CSS variable system (`[data-theme="light"]` override on `:root`) works with any non-`"light"` data-theme value. ### Developer Validations - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:40 -05:00
yindo closed this issue 2026-02-22 18:36:40 -05:00
yindo changed title from [PR #5007] feat: dedicated dark theme option with system preference support to [PR #5007] [MERGED] feat: dedicated dark theme option with system preference support 2026-06-05 15:20:44 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4857