Add env variable to set default light/dark mode option, For when no set preference exists #1695

Closed
opened 2026-02-05 01:38:25 +03:00 by OVERLORD · 8 comments
Owner

Originally created by @mahdi1234 on GitHub (Apr 30, 2020).

Describe the feature you'd like
Add .env setting for default to be dark mode.

Describe the benefits this feature would bring to BookStack users
Customization of bookstack appearance without using themes. Also since mode toggle is on home page anyone going to direct link can be forced to dark mode.

Additional context
Hope I haven't missed it, but I couldn't find it here https://github.com/BookStackApp/BookStack/blob/master/.env.example.complete

Originally created by @mahdi1234 on GitHub (Apr 30, 2020). **Describe the feature you'd like** Add .env setting for default to be dark mode. **Describe the benefits this feature would bring to BookStack users** Customization of bookstack appearance without using themes. Also since mode toggle is on home page anyone going to direct link can be forced to dark mode. **Additional context** Hope I haven't missed it, but I couldn't find it here https://github.com/BookStackApp/BookStack/blob/master/.env.example.complete
OVERLORD added the 🔨 Feature Request🎨 Design🏭 Back-End labels 2026-02-05 01:38:25 +03:00
Author
Owner

@ssddanbrown commented on GitHub (May 1, 2020):

Hi @mahdi1234,
Could you describe what is meant by this?

Customization of bookstack appearance without using themes. Also since mode toggle is on home page anyone going to direct link can be forced to dark mode.

The dark-mode in BookStack is a user-level preference. It should not affect other users in the system.

@ssddanbrown commented on GitHub (May 1, 2020): Hi @mahdi1234, Could you describe what is meant by this? > Customization of bookstack appearance without using themes. Also since mode toggle is on home page anyone going to direct link can be forced to dark mode. The dark-mode in BookStack is a user-level preference. It should not affect other users in the system.
Author
Owner

@mahdi1234 commented on GitHub (May 1, 2020):

Hi @ssddanbrown maybe I described that bit confusing, basically I would like to have a setting for default theme light/dark, so when I give someone direct link to page_xyz it's dark on first visit. Sure he can change later on to white, but it's about first visit, does it make sense? I'm the only user on system and have read-only system for guests.

@mahdi1234 commented on GitHub (May 1, 2020): Hi @ssddanbrown maybe I described that bit confusing, basically I would like to have a setting for default theme light/dark, so when I give someone direct link to page_xyz it's dark on first visit. Sure he can change later on to white, but it's about first visit, does it make sense? I'm the only user on system and have read-only system for guests.
Author
Owner

@ssddanbrown commented on GitHub (May 1, 2020):

@mahdi1234 Ah, Okay, that makes sense. Thanks for confirming, I'll update the title.

@ssddanbrown commented on GitHub (May 1, 2020): @mahdi1234 Ah, Okay, that makes sense. Thanks for confirming, I'll update the title.
Author
Owner

@mind-overflow commented on GitHub (Jul 8, 2020):

Hey! Any updates on this?

@mind-overflow commented on GitHub (Jul 8, 2020): Hey! Any updates on this?
Author
Owner

@ssddanbrown commented on GitHub (Jul 8, 2020):

Hey! Any updates on this?

Nope, nothing yet

@ssddanbrown commented on GitHub (Jul 8, 2020): > Hey! Any updates on this? Nope, nothing yet
Author
Owner

@FrostyWolf commented on GitHub (Oct 30, 2020):

Is there still no way to change the default theme to dark?

@FrostyWolf commented on GitHub (Oct 30, 2020): Is there still no way to change the default theme to dark?
Author
Owner

@modem7 commented on GitHub (Jan 3, 2021):

+1 on this. My retinas would certainly appreciate it whenever I hit the home page after reloading the container, and it defaults to light theme until I login.

Alternatively, if an ENV var isn't suitable, maybe a global setting for "default mode" in the settings tab where admins can choose what they'd like the default to be, and users can choose their preferred in their user settings?

@modem7 commented on GitHub (Jan 3, 2021): +1 on this. My retinas would certainly appreciate it whenever I hit the home page after reloading the container, and it defaults to light theme until I login. Alternatively, if an ENV var isn't suitable, maybe a global setting for "default mode" in the settings tab where admins can choose what they'd like the default to be, and users can choose their preferred in their user settings?
Author
Owner

@ssddanbrown commented on GitHub (Feb 8, 2021):

Code added in b0f4500c34.

As of the next feature release (v0.32), You'll be able to set APP_DEFAULT_DARK_MODE=true to enable dark mode by default. This will be overidden for any users/sessions that have previously pressed one of the dark/light mode toggle buttons.

@ssddanbrown commented on GitHub (Feb 8, 2021): Code added in b0f4500c3419b10317c5e976f6bd357efdf8b049. As of the next feature release (v0.32), You'll be able to set `APP_DEFAULT_DARK_MODE=true` to enable dark mode by default. This will be overidden for any users/sessions that have previously pressed one of the dark/light mode toggle buttons.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1695