Extension talk:DarkMode

About this board

How can this be installed as a gadget which does not need a dark mode toggle but is always on

3
Amousey (talkcontribs)

As CSS and JS it should be possible to use this either as a gadget only (no install) or as a user script and css, but how? Tye js needs modifying to do this.

MusikAnimal (talkcontribs)
Artoria2e5 (talkcontribs)

There seems to be quite a bit of divergence between the gadget and the extension. Maybe something can be done to sync them?

Reply to "How can this be installed as a gadget which does not need a dark mode toggle but is always on"

It seems "mw-no-invert" is still slightly color-altered

4
SolidBlock (talkcontribs)

I found the images or elements with mw-no-invert class are still slightly color-altered. I looked into it and found the two hue-rotate(180deg) did not exactly return to the original color. invert() does not influence this.

See this example.

Derf Jagged (talkcontribs)

"filter: unset" should return it to normal. Definitely should be a configuration option though.

SolidBlock (talkcontribs)

filter: unset equals to filter: none. It does not remove filters applied by parent elements.

Derf Jagged (talkcontribs)

Apologies; I meant to apply "filter: unset" on the root element where the original filter is set. Then you can implement your own class (.client-darkmode .invertible) on elements you want to invert - if you were wanting any to be inverted in the first place.

I ended up just ditching the built-in resources/ext.DarkMode.less file altogether and making my own for that very reason, but also to maintain more control (example).

Reply to "It seems "mw-no-invert" is still slightly color-altered"
66.190.177.36 (talkcontribs)

I installed it to extensions and added the following in LocalSettings.php

wfLoadExtension( 'DarkMode' );

The Darkmode shows up but when I click it all it does is adds a # to the end of the url.

It also does not change to Default

Thanks.

MusikAnimal (talkcontribs)

What MediaWiki version, browser, and skin are you using? It sounds like a JavaScript error. See w:WP:JSERROR on how to report those.

66.190.177.36 (talkcontribs)

Mediawiki 1.39.1

Firefox 112.0.2 (64-bit)

vector


The resource from “<url that it won't let me post>/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)


Thanks

Reply to "Does not toggle."

The extension is always not persistent for users non logged

2
Pacha35 (talkcontribs)

Hi,

I try today this extension and non-logged users have to toggle in dark mode at each page. Is there a fix to that problem ?

Regards

PerfektesChaos (talkcontribs)

Please see Topic:Wpakcrc34z4v9qmc; a cookie might memorize the last used preference, for both registered and anonymous users.

Reply to "The extension is always not persistent for users non logged"

Wiki logo in negative

1
Pacha35 (talkcontribs)

Hi,

in darkmode, the logo of the wiki is in negative photo mode. How can I fix this ?

Regards

Reply to "Wiki logo in negative"

Not working on mobile site

2
Ryoya3 (talkcontribs)

This extension does not work on mobile sites.

To be more specific, first of all, there is no button to enable or disable dark mode on the mobile site, and even if you log in with the same account and turn it on on the desktop site, it will not apply to mobile.

ArchATempAcct (talkcontribs)

Can confirm. Does not work on mobile. Disappointing.

Reply to "Not working on mobile site"

Bottom corners remain white

3
Summary by SyncmasterN

Fixed

SyncmasterN (talkcontribs)

Hi, I was using the DarkMode extension recently and I am not really sure why the two bottom corners always remain white.

(for more context: if a page is longer and you have to scroll, the left and right sides cut from dark to white at some point)

I searched everywhere but didn't find anything documenting this.

Installed software

Product Version
MediaWiki 1.39.0
PHP 8.1.8 (fpm-fcgi)
MariaDB 10.7.7-MariaDB
ICU 67.1
Lua 5.1.5
Pygments 2.11.2
Extension Version License Description Authors
DarkMode 0.2.0 (2c6c85b) 21:21, 5 December 2022 MIT A toggleable dark mode for the MediaWiki user interface MusikAnimal and R4356th

I can see the same behaviour on example wiki at https://meta.miraheze.org/wiki/Miraheze when toggling on dark mode.


Thanks

Lomeno 24 (talkcontribs)

Sorry to bring this up but I am also having this same problem on my wiki and I have not found a solution to the problem, I am still having this problem.

SyncmasterN (talkcontribs)

It wasn't obvious at first but nl6720 posted the fix here

You have to add the following code here to your MediaWiki:Common.css

/* Work around a bug in Extension:DarkMode where it sets the background color to
 * black and then inverts it.
 */
@media screen {
	html.client-darkmode {
		/* body-background-color from https://github.com/archlinux/archwiki/blob/master/extensions/ArchLinux/modules/arch_definitions.less */
		background-color: #f6f9fc;
	}
}
TimRiker (talkcontribs)

It would be nice if Dark Mode were not applied to the "Printable version". Is there a built in option for that?

Reply to "Printable version"

Make DarkMode the default?

2
24.17.198.38 (talkcontribs)

Hi, when I navigate to my mediawiki installation, I can see the Darkmode toggle but I have to click it to change to dark mode. If I log out, the wiki changes back to light mode. Is there any way to always make Darkmode the default logged in or out? Thank you.

PerfektesChaos (talkcontribs)

Basically yes.

Developers might create a cookie which is bound to browser profile and would memorize last state until cookies are deleted or browser account or device is changed or preference is explicitly set again.

Reply to "Make DarkMode the default?"

Feature Request: Option to not invert colors by default

2
Derf Jagged (talkcontribs)

It would be nice if DarkMode had a toggle to *not* invert anything by default, just provide the switch and the HTML-level class to be able to make ".client-dark-mode" CSS rules. Un-inverting images with another filter does not always bring it back to the correct colors exactly and it's tricky to get the exact background colors you want via CSS since it's all being inverted.

Derf Jagged (talkcontribs)

It appears just doing "filter: unset" on `.client-dark-mode` does just that. Would be lighter to have an extension variable control that though.

Reply to "Feature Request: Option to not invert colors by default"