HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

User selectable themes/ night mode

Hey everyone. I was thinking it would be great if my users could select an alternate CSS file for their visits to the site so that I could have a bright look and a dark look. Users would see whichever look suits their preference. I didnt see a plugin that lets users swap themes or toggle optional CSS but I thought maybe one of you has already implemented something like this or there are some thoughts here on how best to go about it. Thanks.

Tagged:

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    This can be browser options. But if you desire more, there are options but they are based on the theme you selected.

    Considering there are considerable amounts of themes for vanilla, this is a niche option which has been addressed as best as possible by other users who thought the idea was worth creating a plugin that addresses this … Look at plugins by R_J….

    Usefulness depends on demand… Most people don't give a dam unless the content is worth reading…

  • R_JR_J Ex-Fanboy Munich Admin

    I cannot tell if it works since I have never used it, but here is a plugin which seems to do exactly what you ask for: https://vanillaforums.org/addon/themechooser-plugin

  • RajioRajio
    edited August 2016

    Tried it out but it doesn't seem to work. Its not adding a new CSS line to my pages to call any new CSS file as far as I can see.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    @Rajio said:
    Tried it out but it doesn't seem to work. Its not adding a new CSS line to my pages to call any new CSS file as far as I can see.

    I think this only works with the theme Bootstrap…

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    I used this code from Dynamic Drive to achieve what you are looking for on my site.

    http://dynamicdrive.com/dynamicindex9/stylesheetswitcher.htm

    Add the js file to your theme folder and follow the simple instructions to add links to different css files.

    You can see it work here: www.whu606.com - click on Links and choose Stealth.

  • @vrijvlinder said:

    @Rajio said:
    Tried it out but it doesn't seem to work. Its not adding a new CSS line to my pages to call any new CSS file as far as I can see.

    I think this only works with the theme Bootstrap…

    Hmm. That may be the holdup. I'll try @whu606's dynamicdrive code. Thanks!

  • PS that Stealth skin is hilarious. lol

  • RajioRajio
    edited August 2016

    [DELETE ME]

  • RajioRajio
    edited August 2016

    Woops I've figured it out.

    A: Update the plugin's PHP file from GITHUB
    B: Use Bootstrap as your theme.
    C: in the plugin's settings page (dashboard) you've got to define the CSS files with the 'custom_' prefix. ie; custom_cyborg to enable the Cyborg bootstrap sub-skin.

    Voila.

Sign In or Register to comment.