antfu / vscode-iconify

🙂 Iconify IntelliSense for VS Code
https://marketplace.visualstudio.com/items?itemName=antfu.iconify
MIT License
464 stars 34 forks source link

feat: change icon color based on activeColorTheme.kind #19

Closed cyrilf closed 2 years ago

cyrilf commented 2 years ago

:bulb:

Issue

When using a theme that doesn't contain dark | black | light in its name, the auto color detection was failing. (for example: 'Noctis Lux')

Solution

Use the window.activeColorTheme.kind provided by vscode ~instead~ in priority of the regex matching on the theme's name.

Before
before
Can't see the icon on this light theme
After
after
All good

Related to #6

antfu commented 2 years ago

We could have the original approach as a fallback when window.activeColorTheme.kind is not presented.

cyrilf commented 2 years ago

@antfu yes sure, I can update the PR and do that. But before I do so, why wouldn't window.activeColorTheme.kind be presented? (I never developed any vscode extension before)

antfu commented 2 years ago

I don't think the API exists when I made this plugin. So for who knows reason someone might still use an older version of VS Code - having the fallback just to be safe.

cyrilf commented 2 years ago

Alright, got it. PR updated :sparkles:

antfu commented 2 years ago

Thanks!