wallabagger icon indicating copy to clipboard operation
wallabagger copied to clipboard

Switch icon to white when browser is in dark mode

Open BuzzKnightbeer opened this issue 6 years ago • 4 comments

When Firefox is set to dark mode / theme the icon stays black and doesn't really fit in. It would be great if it could switch do a white icon when the current page is not yet saved.

wallabagger_darkmode

BuzzKnightbeer avatar Dec 10 '18 05:12 BuzzKnightbeer

Is it possible to detect if the theme is dark? The better solution might be an outlined icon. like in the edge version of wallabagger

Rurik19 avatar Dec 10 '18 07:12 Rurik19

Is it possible to detect if the theme is dark? The better solution might be an outlined icon. like in the edge version of wallabagger

I'm no developer, so I don't know if this is helpful, but I found this:

How to correctly design color icon to be visible accross themes How to detect Firefox Theme

BuzzKnightbeer avatar Dec 10 '18 12:12 BuzzKnightbeer

Firefox supports specifying dark and light versions of the browser action icon in the manifest. This is not supported elsewhere AFAIK but would be worth doing.

"browser_action": {
  "default_title": "Wallabagger",
  "default_icon": "img/wallabagger-dark.svg",
  "theme_icons": [{
    "dark": "img/wallabagger-dark.svg",
    "light": "img/wallabagger-light.svg",
    "size": 32
  }],
  "default_popup": "popup.html"
}

Unfortunately, I don't know that we can detect whether a theme is light or dark - which you'd need to do here otherwise the icon will revert back to the default colour after it's clicked.

ghost avatar Dec 31 '19 19:12 ghost

Actually, it looks like passing null to setIcon produces the desired behaviour of setting the icon to the theme appropriate default.

I've updated #182 to include light and dark icon variants. :)

ghost avatar Dec 31 '19 20:12 ghost

#256

Simounet avatar May 11 '23 15:05 Simounet