Open Gunnar-GO opened 3 years ago
Thanks. It may be due to the "*" character I add to the "toggle dark mode" text to indicate when it's turned on. I will have to look.
I confirm this issue too. Do you have any workarounds for now?
Also the issue only appears when logged in. When anonymous the issue manifests a bit differently, with the content having too much top padding and leaving weird blank space
@danneu , i commented out the added *, no difference.
the header line not uses the fixed-statement. sadly it isn't overwritten so the problem lays at another position.
I looked. It's caused by:
body.darkmode {
filter: invert(1) hue-rotate(180deg);
}
Almost any value for filter
will introduce the gap. Weird. Will investigate.
Looks like it's this quirk: https://stackoverflow.com/questions/52937708/why-does-applying-a-css-filter-on-the-parent-break-the-child-positioning
A targeted patch seemed like a good enough solution: https://github.com/danneu/MediaWiki-DarkMode/commit/53452fb1b764f1f5c9b145fcf4a42d3189af7142
Looks like there are some more fixed components (notification?) that introduce some other instances of this problem I can fix.
Edit: I couldn't reproduce the issue I thought I saw. Anyways, feel free to report more issues as they come up.
I am having the same issue here. I tried to use your patch but it not worked.
@arddhu-hub Hmm, I will have to take another look then.
Until then, I suppose you can double-check for me that the old unpatched CSS file isn't being served from cache.
Did checked that, my site is wiki.runeterra.org if you want to take a look. It only happens when someone logged togle it.
Em ter., 29 de dez. de 2020 às 00:24, Dan notifications@github.com escreveu:
@arddhu-hub https://github.com/arddhu-hub Hmm, I will have to take another look then.
Until then, I suppose you can double-check for me that the old unpatched CSS file isn't being served from cache.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/danneu/MediaWiki-DarkMode/issues/1#issuecomment-751932878, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARQN2AIK4MZSAAXR6LEOOALSXFDWFANCNFSM4UICUNPA .
This is embarrassing, but my fix doesn't work. It doesn't even target the right element, nor would it even work if it did.
I was too hasty and wasn't testing what I thought I was.
I have an idea for a fix that I'm testing right now.
No problem, if you need to test in somewhere else, just let me know.
Em qui., 31 de dez. de 2020 às 01:57, Dan notifications@github.com escreveu:
This is embarrassing, but my fix doesn't work. It doesn't even target the right element, nor would it even work if it did.
I was too hasty and wasn't testing what I thought I was.
I have an idea for a fix that I'm testing right now.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/danneu/MediaWiki-DarkMode/issues/1#issuecomment-752843799, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARQN2AO6PWC3C5DWMC3BHIDSXQAE3ANCNFSM4UICUNPA .
One elegant fix is to apply the CSS filter
to <html>
instead of <body>
, as filter
doesn't impact position: fixed
when applied to the root element.
However, this is only possible with MediaWiki's API as of v1.35 (released July 2020). Are you on that version?
I have some hack ideas for earlier MediaWiki versions, but they would take me longer to test.
No, I am at 1.34.1
Em qui., 31 de dez. de 2020 às 03:12, Dan notifications@github.com escreveu:
One elegant fix is to apply the CSS filter to instead of
, as filter doesn't impact position: fixed when applied to the root element.However, this is only possible with MediaWiki's API as of v1.35 (released July 2020). Are you on that version?
I have some hack ideas for earlier MediaWiki versions, but they would take me longer to test.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/danneu/MediaWiki-DarkMode/issues/1#issuecomment-752858297, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARQN2AIMJZKBPUPZBHVMOMDSXQI4RANCNFSM4UICUNPA .
i am have a 1.35 test-instance. i can run try a try if you want.
I don't have time anytime soon, but if you want to try this hack out yourself:
$output->addBodyClasses(["darkmode"])
to $output->addHtmlClasses(["darkmode"])
(This is the unstable feature that only works since v1.35)<body class="darkmode">
has been moved to <html class="darkmode">
, change the Javascript (ext.DarkMode.js) from document.body.classList.add("darkmode") and .remove("darkmode")
to document.documentElement.classList.add("darkmode") and .remove("darkmode")
. This affects the <html>
element.body
reference from the CSS file (ext.DarkMode.less). I believe you can just change body.darkmode
to .darkmode
.I wrote this from my phone and mostly memory so realize that this might not be perfect, but this is the general gist.
@danneu your extension is not working whenever I try it.
—
MediaWiki internal error.
Original exception: [f090865409d8a5ad4c826ba5] /index.php/Main_Page Error: Call to undefined method User::isLoggedIn() Backtrace: from /home/allajwzo/wiki.allan.network/extensions/DarkMode/includes/Hooks.php(35)
Exception caught inside exception handler: [f090865409d8a5ad4c826ba5] /index.php/Main_Page Error: Call to undefined method User::isLoggedIn() Backtrace: from /home/allajwzo/wiki.allan.network/extensions/DarkMode/includes/Hooks.php(35)
In Timeless the top bar will be moved by ~47 px from TOP if in dark mode. A behavior that doesn't appear in the original extension.