@keng-her Thank you. I'll back everything up and try that and report back.
Force/use Night mode plugin by psyckobunny by default
Unsolved
Technical Support
-
Re: Dark/night Mode to ignore or add Less CSS on admin Dashboard
Hello everyone, hello @psychobunny @psychobunny-0
I installed the psychobunny/nodebb-plugin-night-mode plugin and my custom CSS works great.
My question is that I would like to know if it was possible to force the activation of night mode for all users by default, while leaving them the possibility to switch to the default theme.
thanks in advance
-
here the JS CODE:
"use strict"; $(document).ready(function () { var panel = $('<li class="lights-out"><a title="Dark Theme" href="#"><i class="fa fa-fw fa-lightbulb-o"></i><span class="visible-xs-inline">Dark Theme</span></a></li>'); $('ul#logged-in-menu').prepend(panel); $('ul#logged-out-menu').prepend(panel); if (utils.findBootstrapEnvironment() === 'xs') { $('#menu').prepend(panel); } var enabled = localStorage.getItem('user:theme') === 'lights-out'; $('body').toggleClass('lights-out', enabled); panel.on('click', function () { enabled = !$('body').hasClass('lights-out'); $('body').toggleClass('lights-out', enabled); localStorage.setItem('user:theme', enabled ? 'lights-out' : ''); }); panel.find('a').tooltip({ placement: 'bottom', title: 'Dark Theme', }); });
-
@downpw by source code I mean the plugins code in GitHub. The css is somewhere there.
nodebb-plugin-night-mode/style.less at master · psychobunny/nodebb-plugin-night-mode
Adds a lightbulb icon to your persona theme's header to toggle a dark skin - nodebb-plugin-night-mode/style.less at master · psychobunny/nodebb-plugin-night-mode
GitHub (github.com)