darkreader icon indicating copy to clipboard operation
darkreader copied to clipboard

Feature request: separate black/white lists

Open ershov opened this issue 9 years ago • 14 comments

Hi, I love this extension and I have a proposal for improvement. Today, there's only one list of sites which acts as 'inverted list' or 'no touch list' depending on the mode. This doesn't make much sense because the sites that are chosen to be inverted should always be inverted, not depending on the default mode. And vice versa. The suggestion is: there should be two separate lists for sites to be inverted and for sites to stay untouched. And the 'default' mode will do the default to the sites that are not in any of the lists.

ershov avatar Jun 12 '16 04:06 ershov

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/piharpi/klise/nnaxhjgcq
✅ Preview: https://klise-git-fork-nickyvanurk-fix-dark-light-mode-flicker.piharpi.vercel.app

vercel[bot] avatar Sep 14 '20 16:09 vercel[bot]

Thank you for submitting this, @nickyvanurk.

you can remove script tag in footer.html and add into header.html

<head prefix="og: http://ogp.me/ns#">
  ...
  <link rel="stylesheet" href="/assets/css/style.css" />
  <!-- add main js script -->
  <script src="/assets/js/main.js" defer="defer"></script>
</head>

No need to add manually on every page.

fahmiirsyadk avatar Sep 15 '20 10:09 fahmiirsyadk

Hey @fahmiirsyadk I see you have changed your comment haha?.

The notransition class is only for the first render, after that I remove this class as I kinda like to keep transitions on elements/theme switch, it looks nice. Without it you would still see a flash of darkness when using the light theme on initial page load because of the 75ms transition.

Also I've read in multiple places on the web it is recommended to keep the JavaScript regarding dark/light theme inline for better performance, instead of loading an external file.

The (remaining) JavaScript in main.js is not required at the top of the page, it does not fix the problem with defer because defer scripts only get loaded after the page has loaded, resulting in the same problem (flash or darkness). Without defer it has to be below the body tag, but then you get worse performance than using inline JavaScript and the current JavaScript references the light icon in the nav which at that point would not have been loaded just yet. The performance would only decrease when users add other JavaScript to the file. I would keep it in the footer.

Let me know your thoughts.

nickyvanurk avatar Sep 15 '20 19:09 nickyvanurk

I'm so sorry, the reason I change my comment because it works when I try to deploy it. Before that, (on my local machine) I see border and colors keep flashing from dark to light, I've no idea about that.

flash

And about the JavaScript, I agree defer is the problem

Thanks, for your corrections.

Once again I'm sorry.

fahmiirsyadk avatar Sep 16 '20 02:09 fahmiirsyadk

Thank you @nickyvanurk and @fahmiirsyadk for discussing this issue I think #25 dark light mode flicker bug has gone

piharpi avatar Sep 16 '20 03:09 piharpi