Hi there,

I've been working on a personal D9 site that uses your module for a fun front-end theming challenge. In addition to needing D9 compatibility patches, I kept making changes to it to fit my needs. As a result, this is the first module I'll have contributed code to and I think I'd like to continue maintaining it so it can get an official D9 release. I've attached the patch and listed the changes I made below.

Problem/Motivation

  • Module does not have Drupal 9 compatibility
  • Class is hard-coded and can't be updated
  • Element that receives the class is hard-coded and can't be updated
  • Storage of user preference relies on cookies, which can be problematic for sites needing to show a cookie acceptance dialog.
  • Module does not account for system color mode settings
  • jquery.once was a missing dependency for anonymous users

User interface changes

  • Added an admin configuration page that allows the class name and the parent element to be set.

API changes

  • Updated to be installed on Drupal 9.
  • Explicitly includes jquery.once as a dependency.

Data model changes

  • User preference relies on local storage instead
  • On first visit, the user preference will first check if there's a system level color mode.
CommentFileSizeAuthor
dark_mode_switch.patch7.51 KBbrotkel

Comments

brotkel created an issue. See original summary.

avpaderno’s picture

Title: Willing to maintain and 1.4 release » Offering to maintain Dark Mode Switch
Component: Code » Miscellaneous
Status: Patch (to be ported) » Active
natts’s picture

Hey, your proposal sounds great. Please follow the instructions on this issue to become a module maintainer: https://www.drupal.org/project/dark_mode_switch/issues/3235687

natts’s picture

natts’s picture

natts’s picture

natts’s picture

avpaderno’s picture

Status: Active » Closed (duplicate)
Related issues: +#3235687: Offering to maintain Dark Mode Switch
geoanders’s picture

Title: Offering to maintain Dark Mode Switch » Dark Mode Switch Improvements
Version: 8.x-1.x-dev » 8.x-2.x-dev
Assigned: Unassigned » brotkel
Category: Support request » Feature request
Status: Closed (duplicate) » Needs review

@brotkel

I added you to the project. Please apply patch to 8.x-2.x branch and test. I can help merge in changes or review as well. Just let me know.

geoanders’s picture

Component: Miscellaneous » Code

  • geoanders committed a2fc249 on 8.x-2.x
    Issue #3249838 by brotkel, geoanders: Dark Mode Switch Improvements.
    
geoanders’s picture

Assigned: brotkel » Unassigned

Applied patch and currently testing in local instance.

geoanders’s picture

Seems to be working after a few adjustments in 8.x-2.x branch.

geoanders’s picture

Status: Needs review » Fixed
geoanders’s picture

geoanders’s picture

Status: Fixed » Closed (fixed)