Skip to content
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

Some themes render with wrong fallback color #100

Closed
octref opened this issue Nov 13, 2020 · 1 comment
Closed

Some themes render with wrong fallback color #100

octref opened this issue Nov 13, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@octref
Copy link
Collaborator

octref commented Nov 13, 2020

From #45 (comment)

For a VS Code theme, the canonical way to specify a fallback color should be to include a settings key as first property of tokenColors with no scope, for example:

https://github.com/arcticicestudio/nord-visual-studio-code/blob/36dac6cae5996995543af99c12e23587028913a5/themes/nord-color-theme.json#L266-L272

Some theme does not do that, and vscode-textmate would generate a wrong color map.
I asked vscode-textmate in this case to use colors['editor.foreground'] and colors['editor.background'] as a fallback, but was pointed to open an issue in VS Code to fix their themes. I then opened a PR but that was closed: microsoft/vscode#105418

So here we have to do our own logic: If there's no no-scope global setting with fallback colors, we have to manually insert it into the theme so vscode-textmate can tokenize with correct color.

@octref octref added the bug Something isn't working label Nov 13, 2020
@octref octref closed this as completed in 7226954 Nov 13, 2020
@vinkla
Copy link

vinkla commented Nov 13, 2020

Thanks for pushing a fix for this issue @octref! Keep up the good work 👏

antfu added a commit that referenced this issue Jan 26, 2024
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants