Light and Dark Mode Icons for Extensions
Reported by
mohamma...@gmail.com,
Oct 8
|
|||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3569.0 Safari/537.36 Steps to reproduce the problem: 1. Open an Incognito window, or 2. Use a dark theme, or 3. Use the new dark mode (to be supported in Chrome) What is the expected behavior? What went wrong? There always was a problem with how browser actions looked in darker UI (mainly in Incognito mode, and when dark themes are used). And now, with the adding of the new dark mode (crbug.com/850098), this problem will become more annoying for a lot more users. For Incognito mode (which is currently dark) there was a workaround. Developers can call `chrome.browserAction.setIcon()` for every tab and use a lighter browser action icon when the tab is in an incognito window. But this workaround can't be used to deal with dark themes, nor with the new dark mode, because there is no clue if the current theme is light or dark, and whether dark mode is turned on or off (in macOS Mojave). If I want to talk about a possible solution here for all the previous cases, I think there has to be a way to determine if the current "theme" (be it a dark mode, incognito, or a custom theme) is light or dark. That will allow developers to choose the right icon and adapt to different themes/modes. Also, I think extensions should be allowed to provide different icons for light and dark browser UI, and Chrome will automatically choose the proper icon. P.S. I found out later that there is a Web Extensions proposal for something similar to what I suggested here. Check the property "theme_icons" here: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action WebStore page: Did this work before? No Chrome version: 71.0.3569.0 Channel: dev OS Version: OS X 10.14.0 Flash Version:
,
Oct 8
,
Oct 18
mohammadhi@ Thanks for the issue. From the above description, this looks like a Feature Request to be allowed to provide different icons for light and dark browser UI, and Chrome will automatically choose the proper icon. Marking this as Untriaged, adding the appropriate labels and reqsting Dev to look into the issue and help further. Thanks..
,
Oct 18
> provide different icons for light and dark browser UI Yes, for native browser UI. And also for custom themes, which means detecting if the custom theme is a dark or light one (from its colors?) and choosing the proper icon.
,
Oct 18
devlin@ are you the right person for this? If not, could you route?
,
Oct 19
I like this idea a lot. We've thought about how we might be able to expose the current theme to extensions in order to allow them to use this information. I don't think there's any real reason not to. yyushkina@, I wonder if this ties in with some of the other theme work you're investigating?
,
Oct 19
,
Oct 22
Adding Mark to this who's PM'in the work on dark mode, Ramya for consideration around creating a way to detect whether a theme is dark (which would be useful beyond this request), and Peter in case he's thought of this.
,
Oct 22
Scattered thoughts: * It's less useful to know "is the theme light/dark" than "what color is this icon atop". So for example if we're talking about browser action icons, then the relevant colors are the toolbar color and the menu background color. Those may be different from each other, and they may both be very different from the colors used in the rest of the theme. * Really, knowing about colors or light/darkness is a means to the end of having enough contrast that the icon stands out. The goal is not so much "light/dark-tuned icons" as "readably-high-contrast icons". * Toolbars may have background images, complicating the question of what the background color is; but I'm prepared to set that aside and assume the theme toolbar color is the representative color in that case. * This is basically the same problem webpage favicons face, since tabs can have any background color. One common solution there is to provide images that will look good over a range of background colors. Putting all those together: * We should probably recommend authors explicitly test their extensions with various background colors, rather than assuming a light neutral background. * We could perhaps allow extensions to provide multiple icons, which the browser could dynamically switch between based on contrast against the toolbar. This would be easier for authors than firing events at the extension and forcing it to update icons every time. To compute contrast against the toolbar, we could get the representative color for the icon (as the theme service does for various theme images today) or allow authors to specify the color to be used in the calculations for each icon.
,
Dec 28
mehmet@ points out that there's also an issue with extension popups in https://bugs.chromium.org/p/chromium/issues/detail?id=850098#c43 I think maybe the prefers-color-scheme media query (Issue 889087) would be the way to go here.
,
Jan 4
re 10, don't stop at icons please. If the API event will be exposed to extensions (at least) they could switch colors of their browserAction popup window. Currently it's highly disruptive to see white popups in an overall dark UI theme, especially if the entire OS uses a dark theme. Having a per-extension switch of light/dark theme is obviously counter-productive and very last-century UX-wise. If not an API event, maybe at least expose it via a predefined CSS variable accessible via var() or env() so the extension could analyze it BEFORE the first frame is painted and switch its inline styles accordingly.
,
Jan 5
I largely agree with pk. Iconography is important and the extension developers should be testing that it is visible and recognizable against a variety of backgrounds. If we invest anywhere, we might follow Apple and support template-style iconography -- monochromatic glyphs that use masking to define shape -- in order to universally theme/style them in a way that makes them always visible. Still, not the easiest mechanism to get right. As per c#11, the media query should allow the content area to adapt as necessary.
,
Jan 5
re c#13, Please don't follow the Safari way. While it works well for abstract primitive items (like arrows, stars), sometimes it's barely possible do design a monochromatic icon, that will look well inverted, especially for 19x19px size (see my pain in attachment). Another issue is that while mono icon could look well for 1 or 2 extensions installed, more extensions icons will become undistinguishable from each other. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by susan.boorgula@chromium.org
, Oct 8