manugarg / pagenotes-issues

Repository to host issues for the Page Notes extension
16 stars 3 forks source link

Dark mode icon #50

Open digyan opened 1 year ago

digyan commented 1 year ago

Toggle for white icon on dark themes would be great. Pretty much invisible on Chrome dark theme.

image

manugarg commented 1 year ago

Thanks for filing this @digyan! I'll take a look.

s1awek commented 2 weeks ago

I'm still having this problem on my machine, will it be looked into? 2024-09-11_15-46

manugarg commented 2 weeks ago

Sorry, for not reporting back. I researched and found all the options to implement different icons annoying. There are two options:

I'll see what I can do. Thanks for your feedback @s1awek! Please don't hesitate to bump it again in case I don't respond in ~O(days).

manugarg commented 2 weeks ago

@s1awek @digyan Folks, will it be okay if I provide an option to use the dark mode icons? Icons will not switch automatically, but you can set them in options. That we'll not need "scripting" permission and w3c may fix this issue in a few months: https://github.com/w3c/webextensions/issues/229


In case above issue doesn't get resolved and we have to use content scripts, we'll have to do the following:

  1. Inject following script for all URLs:
    matchMedia('(prefers-color-scheme: dark)').addListener(({matches}) => chrome.runtime.sendMessage({ scheme: matches ? "dark" : "light" })
  2. On receiving the message in background, change icons based on the message. Ref: https://stackoverflow.com/questions/58880234/toggle-chrome-extension-icon-based-on-light-or-dark-mode-browser#comment105834368_58882519
s1awek commented 2 weeks ago

Folks, will it be okay if I provide an option to use the dark mode icons?

For me it's ok, just wondering if it will be obvious to other users who install your extension?

manugarg commented 2 weeks ago

@s1awek I am really not sure, but if someone wants it they will have an option. As I said earlier, I am hoping w3c will get implemented for chrome soon. Last week only it got implemented for safari and chrome has been supportive for a while now.

image
s1awek commented 2 weeks ago

Sure, for me this solution is ok :)

manugarg commented 2 weeks ago

I've prepared icons (hopefully good enough). I'll push it soon after some more testing.

manugarg commented 2 weeks ago

I've submitted a new package to chrome webstore - version 3.2.9. It will likely take some time to get reviewed and published.

manugarg commented 2 weeks ago

@s1awek, @digyan

It's published now. Please give it a try if whenever you get a chance.