-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to detect whether a theme is light/dark programatically #46940
Comments
duplicate of #32813 (not exactly, I agree, but it, in the end, it goes in the same direction). Did you try 'currentColor' in your svg? |
@aeschli That issue is about accessing colours; I don't want to know the colour, only if Code considers it light or dark. I don't think currentColor helps - these SVGs are remotely hosted and I need to choose between the black or white one (I can't modify them unless I pull them all down locally). |
@aeschli Is it possible this can be reconsidered? I don't think the "duplicate" case is going to help me, I need to know whether to use the black or white version of my image :( |
Sorry, there are currently no plans for new API in that area. |
@aeschli Are there any workarounds or other ways I could handle do this? It's frustrating that Code has knowledge of the theme but extensions can't make decisions based on it. On a light theme my white images aren't visible, it looks really bad. |
Sorry, I'm not aware of any other tricks. Using images in hover is possible but not really the intended usage of hovers. |
@aeschli The problem is the same wherever I put it. Users have asked for the icon previews in the gutter (this is where IntelliJ shows them) but it's the same issue - we don't know when to use the dark/light versions. Would you accept a PR that added this somewhere if I could figure out how to do it? |
In the gutter you can provide both a light and dark version of your icon |
This has been requested before (#7589) but I don't believe the suggest solution covers all cases (as suggested in the last comment).
I'm trying to insert images into hovers for icons like this:
I have URLs for where the icons live like this:
https://storage.googleapis.com/material-icons/external-assets/v4/icons/svg/ic_favourite_white_24px.svg
https://storage.googleapis.com/material-icons/external-assets/v4/icons/svg/ic_favourite_black_24px.svg
However without knowing whether the theme is Dark or Light, I can't tell which if the colours to insert.
The text was updated successfully, but these errors were encountered: