White or dark theme
#1
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?
Wanna be a moderator? Click here to apply
[Image: imageproxy.png]
Reply
#2
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.
Hey man, what's up?
Reply
#3
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'.
Best regards, Peter.
PHP Developer.


#gitlab #myplugins
Reply
#4
I am gonna add the second theme at 15/1/2020 can someone help me with that?
Or is there any tutorial for that?
Wanna be a moderator? Click here to apply
[Image: imageproxy.png]
Reply
#5
There plugin here you can use https://community.mybb.com/mods.php?acti...w&pid=1158
Reply
#6
(12-22-2019, 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.
Reply
#7
Really Thank you guys.. i think to add a color picker if rhere is any tutorial for a second theme
Wanna be a moderator? Click here to apply
[Image: imageproxy.png]
Reply
#8
(12-23-2019, 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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)