Comments (13)
Legendary - you fixed it. Nice work!
Thanks for your that - I'd almost forgotten about it... ;-)
from mindthedark.
Yes, that's right. I forgot about that. I have to fix that too.
from mindthedark.
Unfortunately, I cannot recreate the behaviour. What browser do you use? Do you have any plugins in your browser that automatically show websites in a dark theme?
from mindthedark.
Interesting - I'm using Firefox - and no plugins to impose dark mode.
I tried it in Chrome and it doesn't happen, so I disabled ALL my extensions and theme (dark theme) in FF and it still occurs.
Tested in a FF private window (ie. most things disabled) and again, it still happens.
Tested in Safari (no plugins whatsoever as I never use Safari) and it also happens.
Odd.
from mindthedark.
The plugin was actually only tested by me with Firefox.
I also only use Firefox. With me it works without problems.
What kind of OS do you use? I used Fedora 33.
from mindthedark.
Hmm...I'm using it on a Hackintosh.
Perhaps I'll boot up linux or Windoze and see what (if any) difference there is.
It's not a big deal as I can just disable the user choice option and the problem goes away.
To the naked eye, it looks like it's rendering the page in white first, then quickly re-renders it in the dark theme.
from mindthedark.
I have the same issue too.
OS: Windows 10 64-Bit
Firefox: Version 95.0 (64-Bit)
This also happens if you have selected the light mode and enabled autoDark.
Edit: I have found a workaround for this problem. You have to change the value below to "0", disable the userChoice setting and then everything works.
Line 57 in b410b4f
2021-12-11_10-41-54.mp4
from mindthedark.
Here the problem seems to be that the server (PHP code) already generates and delivers the HMTL and only in the browser is decided which theme to use. Somehow the display of the website would have to wait until the JS code was executed. Any ideas?
from mindthedark.
Just to describe the behaviour on my system:
Client: Windows 10, Chrome 96.0 (happens with clean profile)
I see the bright flashes only when going back in the browsing history or saving DokuWiki configuration (that does not matter much). When I disable the user selection of the theme then the flashes do not happen. Even if the automatic detection stays enabled.
@MrReSc
So if I understand it correctly on a newly loaded page a JS code must be run to decide which theme to use? Before that the default theme is used? If so then probably the server should remember the user preference and use the theme according to that.
Suggesting a (probably) small change for a little better behaviour: The first displayed theme (before the JS) should be the one set in the settings. Then the flashes would happen only for users who override the default setting.
from mindthedark.
So if I understand it correctly on a newly loaded page a JS code must be run to decide which theme to use? Before that the default theme is used? If so then probably the server should remember the user preference and use the theme according to that.
Yes, exactly.
Suggesting a (probably) small change for a little better behaviour: The first displayed theme (before the JS) should be the one set in the settings. Then the flashes would happen only for users who override the default setting.
That's what I was thinking. Or you always use the automatic mode. This is probably even closer to what the user wants.
from mindthedark.
The problem is with the deferred loading that is turned on by default since the latest version. When this is turned off, it no longer flickers.
As an intermediate solution you can set defer_js = false
.
from mindthedark.
I tried to solve the problem using cookies instead of localstorage. It looks quite good. @vbrozik @Gamemap @manicmoose Can you try the latest version?
https://github.com/MrReSc/MindTheDark/archive/refs/heads/master.zip
from mindthedark.
I think you fixed it (I will test it more detailed soon) but because you don't load the tpl_autocolor.php
it isn't possible to change the Note Plugin to dark mode.
from mindthedark.
Related Issues (20)
- Compatibility with Prosemirror WYSIWYG editor for DokuWiki HOT 2
- Compatibility with Struct Schema Editor HOT 4
- highlight not working in dark theme HOT 3
- How to remove border around images? HOT 2
- If userChoice and autoDark are activated, the system color is no longer automatically used. HOT 3
- "Template Style Settings" change the original template not MindTheDark Template HOT 2
- Admin config page: Input elements are not styled HOT 2
- Code File Download HOT 1
- Discussion Plugin: Background color of discussions doesn't change dark/bright HOT 4
- Confirm compatibility with Release 2022-07-31 "Igor" HOT 2
- Text color of tagline doesn't change dark/bright HOT 2
- I found a bug while open image attached on a page: Page style become light HOT 1
- support hidden Plugin HOT 2
- does not work. HOT 2
- Template starts in light mode even when it should start in dark mode HOT 1
- Syntax highlighting for code? HOT 1
- Gap with Struct tables (Struct plugin) HOT 4
- Syntax bug in main.php HOT 1
- Favicon is not loaded HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mindthedark.