Dark/light button buggy in default dark mode #4206

Closed
opened 2026-02-05 08:14:12 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @Bolthier on GitHub (Sep 14, 2023).

Describe the Bug

When defaulting to dark mode through APP_DEFAULT_DARK_MODE=true in the .env the button for toggling between dark and light is not working for the first click. The second click on the button is switching the mode from dark to light.

This behaviour is probably caused by the default function of the button to switch from light to dark.

Steps to Reproduce

  1. Change in .env APP_DEFAULT_DARK_MODE=true
  2. Visit your bookstack instance in a private windows
  3. See dark mode as default
  4. Click on dark/light mode button
  5. Mode is not switching to light mode

Expected Behaviour

The site should change from dark to light on the first press of the button.

Screenshots or Additional Context

No response

Browser Details

Firefox 117 on Windows 10

Exact BookStack Version

BookStack v23.08.2

Originally created by @Bolthier on GitHub (Sep 14, 2023). ### Describe the Bug When defaulting to dark mode through APP_DEFAULT_DARK_MODE=true in the .env the button for toggling between dark and light is not working for the first click. The second click on the button is switching the mode from dark to light. This behaviour is probably caused by the default function of the button to switch from light to dark. ### Steps to Reproduce 1. Change in .env APP_DEFAULT_DARK_MODE=true 2. Visit your bookstack instance in a private windows 3. See dark mode as default 4. Click on dark/light mode button 5. Mode is not switching to light mode ### Expected Behaviour The site should change from dark to light on the first press of the button. ### Screenshots or Additional Context _No response_ ### Browser Details Firefox 117 on Windows 10 ### Exact BookStack Version BookStack v23.08.2
OVERLORD added the 🐛 Bug label 2026-02-05 08:14:12 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Sep 14, 2023):

Thanks for raising @Bolthier, could confirm this.
Have patched in 417705651c, with a test added to cover, to be part of the next feature release.

@ssddanbrown commented on GitHub (Sep 14, 2023): Thanks for raising @Bolthier, could confirm this. Have patched in 417705651c66239e174a2fc2d5d7df6be6ef2ade, with a test added to cover, to be part of the next feature release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4206