[07:45:37] Dark mode for non-vector-2022 skins is broken on meta's main page again. The [dark mode extension](https://www.mediawiki.org/wiki/Extension:DarkMode) says it adds `.client-darkmode` to ``, but this is no longer the case. Since the extension hasn't been updated for a while, perhaps some other update broke that behavior? [09:11:43] [1/19] I did some more testing. This bug only happens when the user is not logged in. It might have something to do with the following js not adding/removing the `client-darkmode` class when the user is not logged in. [09:11:43] [2/19] ``` [09:11:43] [3/19] if ( mw.user.isAnon() ) { [09:11:44] [4/19] // If the user is anonymous (not logged in) write a cookie [09:11:44] [5/19] mw.user.clientPrefs.set( 'skin-theme', darkMode ? 'night' : 'day' ); [09:11:44] [6/19] } else { [09:11:44] [7/19] // If the user is logged in write with API to user settings [09:11:45] [8/19] new mw.Api().saveOption( 'darkmode', darkMode ? '1' : '0' ); [09:11:45] [9/19] if ( darkMode ) { [09:11:45] [10/19] docClassList.add( 'skin-theme-clientpref-night' ); [09:11:46] [11/19] docClassList.add( 'client-darkmode' ); [09:11:46] [12/19] docClassList.remove( 'skin-theme-clientpref-day' ); [09:11:47] [13/19] } else { [09:11:47] [14/19] docClassList.add( 'skin-theme-clientpref-day' ); [09:11:48] [15/19] docClassList.remove( 'client-darkmode' ); [09:11:48] [16/19] docClassList.remove( 'skin-theme-clientpref-night' ); [09:11:49] [17/19] } [09:11:49] [18/19] } [09:11:50] [19/19] ``` [09:21:52] Reported upstream https://phabricator.wikimedia.org/T396102. I can't believe I never tested my dark mode stylesheets as an anonymous user...