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

Test preferred high contrast light color theme #145616

Closed
3 tasks done
aeschli opened this issue Mar 21, 2022 · 6 comments
Closed
3 tasks done

Test preferred high contrast light color theme #145616

aeschli opened this issue Mar 21, 2022 · 6 comments

Comments

@aeschli
Copy link
Contributor

aeschli commented Mar 21, 2022

Ref: #144193

Complexity: 3

Create Issue


We already have a setting workbench.preferredHighContrastColorTheme that lets you specify a theme that is used when 'autoDetectHighContrast' is enabled and the OS enters high contrast mode.

Now we can distinguish between high contrast dark and high contrast light

The existing setting workbench.preferredHighContrastColorTheme is now used as the preferred dark theme
The new setting workbench.preferredHighContrastLightColorTheme is used for the preferred light theme

Note currently only Windows and Mac support setting high contrast dark and light modes. Linux seems to support only a (single) high contrast mode

Test:

  • Makes sure that window.autoDetectHighContrast is true (that's the default)
  • Leave workbench.preferredHighContrastColorTheme and workbench.preferredHighContrastLightColorTheme as default
  • Switch the OS high contrast mode and observe that VS Code updates the theme accordingly
    • On Windows

      • use Use high contrast in the High Contrast settings to enable high contrast mode
      • on the same settings page switch between High Contrast White and High Contrast Black
    • On the Mac use Invert colours in the Accessibility settings page to enable high contrast mode

      • use the 'Light' and 'Dark' mode on the General page
    • On Linux (e.g. Ubunto) use the 'High Contrast` in the Accessibility settings page

      • Ubuntu seems to only have High Contrast mode, no possibility of making it light or dark. For backward compatibility we always use the preferred HC dar theme.
  • close VS Code, make an OS high contrast change and open VS Code. Observe that VS Code updates the theme accordingly
  • Note that in order to switch light/dark in non-high contrast mode you also need to set window.autoDetectColorScheme
  • Set different themes for preferredHighContrastLightColorTheme and preferredHighContrastColorTheme and test that they are used.
@daviddossett
Copy link
Contributor

Should this setting also listen to the "Increase contrast" setting?

CleanShot 2022-03-22 at 10 20 45@2x

@aeschli
Copy link
Contributor Author

aeschli commented Mar 23, 2022

@daviddossett You are correct, my last change modified the behaviour and Increase contrast is no longer used as an indicator for high contrast.

Discussions about this are in
#106704
#107359

I can change this back, let me know what you think.

@aeschli
Copy link
Contributor Author

aeschli commented Mar 23, 2022

I brought back the old behavior for the Mac: High contrast is set if either Invert color or Increase contrast is set (or both)

@daviddossett
Copy link
Contributor

daviddossett commented Mar 23, 2022

I was surprised to see pushback on rendering a HC theme when Increase contrast is enabled. That one makes sense to me.

As I tried this again, Invert colors was the one that took me by surprise since I realized it was flipping over to a dark theme HC (my OS was using a light mode) and then inverting it. I would have expected us to keep the same theme type.

@dbaeumer
Copy link
Member

@hediet assuming you have tested this since you removed your assignment. Closing the item as done.

@aeschli
Copy link
Contributor Author

aeschli commented Mar 25, 2022

With 'invert colors': Yes I agree it's strange that we are in dark appearance but all is light. But it's the case for all applications. IMO it would be wrong to go to dark HC.

@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants