MyBB Community Forums
White or dark theme - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Requests (https://community.mybb.com/forum-65.html)
+---- Thread: White or dark theme (/thread-225805.html)



White or dark theme - Mastersly - 2019-12-22

Hello again,
I search but i didn't find something.
I want a plugin to add a button inthe top of my forum where user can choose between two themes,white or dark.
Should i add a second theme for this?
Can i add a moon button and a sun button.
 When user click the sun it will change the color of my deafut theme and make it white.
When they click the moon it will change to black theme.
Is there a way to do this with one theme or should a add a second theme?


RE: White or dark theme - Michael2014 - 2019-12-22

Yes, of course you need to make a second theme, label your theme now as Sun then duplicate it and call the duplicate theme Moon, then restyle the duplicate theme's color for the moon theme,. Then you can just add the dropdown or selection form to the header. So basic, no plugin needed.


RE: White or dark theme - Salvation - 2019-12-22

You do not need the second theme. You need a second CSS with other colors/styles and several lines of javascript.

So the plugin is OK, but you will still have to (re)write appearance for 'dark mode' because every theme is 'unique'.


RE: White or dark theme - Mastersly - 2019-12-22

I am gonna add the second theme at 15/1/2020 can someone help me with that?
Or is there any tutorial for that?


RE: White or dark theme - DevLife - 2019-12-23

There plugin here you can use https://community.mybb.com/mods.php?action=view&pid=1158


RE: White or dark theme - WallBB - 2019-12-23

(2019-12-22, 08:51 PM)Salvation Wrote: You do not need the second theme. You need a second CSS with other colors/styles and several lines of javascript.

So the plugin is OK, but you will still have to (re)write appearance for 'dark mode' because every theme is 'unique'.

Very good answer.
@OP: you can just add a second CSS and not worry about another theme.


RE: White or dark theme - Mastersly - 2019-12-23

Really Thank you guys.. i think to add a color picker if rhere is any tutorial for a second theme


RE: White or dark theme - WallBB - 2019-12-24

(2019-12-23, 07:51 AM)Mastersly Wrote: Really Thank you guys.. i think to add a color picker if rhere is any tutorial for a second theme

You can basically use a css color invert tool, try these tools
https://goto.pachanka.org/tool/css-color-inverter
https://jalu.ch/coding/css-negative.php

You will also need to tweak it to your liking.

NOTE: I am not endorsing the above projects, these are shared as an example.