shout
shout copied to clipboard
Add theme selector to settings
Adds a theme selector to the settings that allows users to choose a different theme. Themes are managed in config.js and consist of only a CSS file. The default config.js now comes with the default theme and the other 3 that are come in the themes folder preconfigured.
After updating, admins should either add the new theme stuff and remove the old variable, or regenerate a new config.js.
Closes #452 and #90.
:+1: I would love this! Although I feel that the theme list should be automatically detected from the theme folder. I like to create my own themes or modify existing ones after copying them to a different file. I understand this requires extra hassle on the server side, but I think detection would be optimal solution and offers the best user experience.
That said, I still feel this could be merged any time :)
Well, adding themes with this setup only requires adding a few lines to the config file for your instance, It also allows for the theme file to be at any path, or even a URL to one hosted elsewhere.
It looks like this:
{
"name": "Crypto", //Theme name displayed to user
"path": "themes/crypto.css", //Theme path/URL
"default": false //Should the theme be the default for new users
}
This also would allow for a feature in the future to allow users to install their own themes on the frontend just from a URL.
Ok, looks good. For my requirements I just need config reloading after this is implemented :+1:
FYI: Works for me, I've updated my files manually.
Hey @floogulinc, thanks! I left a few comments inline, but I think we are very close to a shippable solution overall, great! :-)
@astorije with all the whitespace stuff, I was just following what was already used in the rest of the file.
Hey @floogulinc, actually, most of the code is func(arg1, arg2)
and not func(arg1,arg2)
so let's keep that version. :-)
Also, I might have been unclear in my last comment, but the problem is some lines of defaults/config.js
are using spaces for indentation where they should be using tabs as the rest of the project.
I can't wait to see this released!! :-)
@astorije OH, thats what you meant, I thought you were talking about the indenting. I'll make some changes when I have the time. I'm going to be quite busy for the next 6 weeks or so.
Argh, it's a shame, this is so close to a shippable solution :-(
Noticed a potential duplicate: https://github.com/erming/shout/pull/386 I'll review and check if they are indeed duplicates or not.