Dark mode not working

Created on 1 May 2023, about 1 year ago
Updated 2 May 2023, about 1 year ago

Problem/Motivation

I can't seem to get dark mode working for the login page. Overriding the logo works just fine.

Steps to reproduce

1. Install Gin Admin theme
2. Install Gin Login
3. Enable Dark Mode in Gin Admin theme
4. Clear all caches
5. Dark mode works in the admin areas but does not carry over to the login page

Drupal 10.0.8

πŸ› Bug report
Status

Closed: cannot reproduce

Version

2.0

Component

User interface

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jabeler
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    I just checked it and darkmode works just fine. Can you share your Drupal version? Also can you try to reload on the login page? Does it pick up darkmode after a reload?

  • Status changed to Postponed: needs info about 1 year ago
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich
  • Running Drupal 10.0.8.

    It turns out this may be browser dependent.

    Works
    Chrome (112.0.5615.137)
    Firefox (112.0.2)

    Doesn't work
    Safari (16.4)
    Brave (1.50.121)

    Tested on macOS 13.3.1 (a)

  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    I actually tested it as well on Ventura with Brave, Chrome, FF & Safari. All browser work for me.
    Do you get any JS errors?

  • No JS errors in any of the browsers.

    Very strange.

    I can test later on another Mac.

  • I believe I may have uncovered the reason why I was seeing issues.

    The Drupal.gin.darkmode key is being cached in local storage, and this doesn't seem to get updated if the setting is changed. Clearing the cache doesn't seem to affect this.

    If I explicitly delete this key and refresh the page, it does get updated and everything works as expected (see screenshots).

    Since this site is not yet live, I don't expect this to be a problem moving forward since all users would get the correct 'auto' key. However, I suppose this could affect sites which are already live and need to change the setting.

    Anyways, the login page looks great so thanks for making this available.

  • Status changed to Closed: cannot reproduce about 1 year ago
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    Thanks @jabeler

    Closing this as gin_login does not alter the state received from Gin but just uses the given state to display it. If there are other issues we might have to open an issue in the Gin issue queue to further investigate it πŸ‘€

Production build 0.69.0 2024