Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    981
    Plugin Contributions
    6

    Default Dark Mode Plugin

    Is there a plugin or template that provides customers with the ability to choose dark mode like I now see on wikipedia.

  2. #2
    Join Date
    Jan 2005
    Posts
    51
    Plugin Contributions
    0

    Default Re: Dark Mode Plugin


  3. #3
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    981
    Plugin Contributions
    6

    Default Re: Dark Mode Plugin

    Here is a video explains the coding, but does not say how to utilize system dark settings.

    How To Make Website DARK MODE | Dark Theme Website Design Using HTML, CSS & JS by How to Become a Developer

    https://www.youtube.com/watch?v=rKqHbLuKaO8

  4. #4
    Join Date
    Jan 2005
    Posts
    51
    Plugin Contributions
    0

    Default Re: Dark Mode Plugin

    Quote Originally Posted by dw08gm View Post
    but does not say how to utilize system dark settings.
    https://stackoverflow.com/questions/...ing-javascript

    to summarize, either use it directly in css
    @media (prefers-color-scheme: dark)
    but thats unwanted, what you want is alternate between css files. So

    window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
    const newColorScheme = event.matches ? "dark" : "light";
    });
    this would do the job.

    I pretty much hacked a dark mode in our shop. Our shop still uses a very very old modified Winchester Responsive template (original from picaflor-azul) thats the reason I am not that helpful in explaining what I all did because its rare to begin with.
    Last edited by nl2dav; 15 Dec 2025 at 07:49 PM.

  5. #5
    Join Date
    Jan 2005
    Posts
    51
    Plugin Contributions
    0

    Default Re: Dark Mode Plugin

    I realize again that I am a bit vague. What I'm trying to say is that

    window.matchMedia('(prefers-color-scheme: dark)')
    returns the flag of the system setting (not the browser setting! See: https://stackoverflow.com/questions/...s-false-when-c )

    and if you have such flag (true or false) then you can change css file links on the fly with help of Javascript. Like that dude is doing with a favicon;

    const setFavicon = () => {
    const favicon = document.querySelector('link[rel="icon"]');
    const matchMedia = window.matchMedia('(prefers-color-scheme: dark)');
    favicon.href = (window.matchMedia('(prefers-color-scheme: dark)').matches)
    ? 'path/to/dark-theme.png'
    : 'path/to/light-theme.png';
    if (navigator.userAgentData.brands[1].brand.includes('Chrome')) {
    favicon.href = 'light-theme.png';
    };
    }


    setFavicon();
    Although he falls back in light mode on Chrome due to some outstanding issue (?).. Its a comment from last year so maybe its fixed by now. Hopefully.
    Last edited by nl2dav; 15 Dec 2025 at 08:09 PM.

  6. #6
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    981
    Plugin Contributions
    6

    Default Re: Dark Mode Plugin

    Thanks for the links and adding clarity to the matter.

 

 

Similar Threads

  1. My Authorize.net Aim works in test mode but not production mode
    By freecat in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 21 Mar 2014, 11:17 PM
  2. Dropdown bg is too dark
    By firefly9 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 8 Dec 2010, 04:08 AM
  3. dark layout
    By chr1831 in forum Basic Configuration
    Replies: 2
    Last Post: 26 Sep 2007, 09:44 AM
  4. shot in the dark....
    By zerocrew in forum General Questions
    Replies: 1
    Last Post: 11 Apr 2007, 08:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg