You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ability to detect whether a theme is light/dark programatically #46940
Martin Aeschlimann (@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).
Martin Aeschlimann (@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 :(
Martin Aeschlimann (@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.
Martin Aeschlimann (@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?
Activity
aeschli commentedon Apr 3, 2018
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?
(https://css-tricks.com/cascading-svg-fill-color/)
DanTup commentedon Apr 3, 2018
Martin Aeschlimann (@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).
DanTup commentedon Apr 18, 2018
Martin Aeschlimann (@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 :(
aeschli commentedon Apr 18, 2018
Sorry, there are currently no plans for new API in that area.
DanTup commentedon Apr 18, 2018
Martin Aeschlimann (@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.
aeschli commentedon Apr 18, 2018
Sorry, I'm not aware of any other tricks. Using images in hover is possible but not really the intended usage of hovers.
DanTup commentedon Apr 18, 2018
Martin Aeschlimann (@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?
aeschli commentedon Apr 18, 2018
In the gutter you can provide both a light and dark version of your icon