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

Combining an HC and non-HC theme doesn't work with "Toggle Light / Dark Theme"? #130

Open
chambliss opened this issue Sep 8, 2023 · 2 comments

Comments

@chambliss
Copy link

Hi,

I opened an issue with VS Code about this, thinking it was a general editor issue, but it turned out to be specific to my Bearded themes. Please see here for the full original issue description and a video illustrating the issue.

After more testing, this combination (both non-HC themes) allows Toggle to work correctly:

{
  "workbench.preferredLightColorTheme": "Bearded Theme Coffee Cream",
  "workbench.preferredDarkColorTheme": "Bearded Theme Arc Blueberry",
}

This one (HC light theme, normal dark theme) doesn't work correctly, and instead causes VS Code to switch to the default HC light theme (theirs), and then to the default HC dark theme, and goes back and forth between those two.

{
  "workbench.preferredLightColorTheme": "Bearded Theme Milkshake Mango",
  "workbench.preferredDarkColorTheme": "Bearded Theme Arc Blueberry",
}

The end result is the minor inconvenience of switching back to using "Preferences: Color Theme" and typing in which theme to use, rather than using the shortcut I had bound to toggling color theme. Not a huge deal but a slight bummer :)

Based on the response I got on the other issue, I believe it's related to using a high-contrast color theme for my light theme and a normal (dark) color theme for my dark theme. I don't fully understand how theming works, but it might be that combining a HC light theme and a non-HC dark theme is just unsupported for this command. If so, feel free to let me know and close this.

P.S. Thanks for making Bearded Themes! I remember Bearded Themes being among the first to ever support semantic highlighting when that was new. I've been using them for many years now. I've made some customizations over time, but they are all incredibly thoughtful and well-designed out of the box.

@BeardedBear
Copy link
Owner

Hi !

I've had a look at the problem and I know where it's coming from.

When we create a theme for VSCode we can choose between 4 types of themes, (sets in package.json file) :

  • light (vs)
  • dark (vs-dark)
  • high contrast dark (hc-black)
  • high contrast light (hc-light)

(yes, it's completely inconsistent)

The problem is that hc-light has a lot of inconsistent behaviour, notably the fact that icon packs that specify icons for light themes behave like icons for dark themes, or certain CSS properties aren't applied in the same way (for example, the background of the active item in the activity bar). So I tried to work around the problem by specifying in my package.json that hc-light icons are considered hc-black icons.

This gives me 2 options:

  • I fix the light themes in high contrast with the correct type (hc-light), in which case I end up with visual inconsistencies.
  • I leave it as it is, and create issues in the vscode repository to list the problems they cause, and then I can fix the problem!

My slightly manic side can't resign itself to accepting the first solution, so I'm going to take some time this week to create issues to hopefully fix these inconsistencies in future versions of VSCode!

But thank you very much for pointing out the problem, like my work and for being so precise!

@chambliss
Copy link
Author

Oh no 😂 I had a feeling it was something like that. It does seem like in general there is less robust support in code editors for light themes (and especially once contrast constraints come into the mix). No worries, I'll continue using my workaround until the situation improves.

Thanks for your quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants