Skip to content

Make high-contrast mode less hacky for Monaco editor in IE and Edge #3690

Closed

Description

In our high contrast theme we are using clever CSS that sidesteps around style overrides IE and Edge do when Windows is in High Contrast Mode.

Fortunately, there's a single rule we can use in CSS now to stop IE 10+ and Edge from trying to modify our styles.

-ms-high-contrast-adjust: none

It overrides the browsers' default behavior to modify the styles to be more high-contrasty. This means we can stop using hacks like ::after and ::before elements to insert icons as non-background images (which would otherwise not be displayed as background images).

We need to test that this works well in Monaco and decide if we are ok only supporting IE 10+ as far as IE goes.

Provided we're all good, then let's replace all the hacks with natural solutions.

https://msdn.microsoft.com/en-us/library/hh771863(v=vs.85).aspx

Activity

  1. added
    accessibility
    themes
    and removed
    accessibility
    on Mar 3, 2016
  2. bgashler1 commented on May 18, 2016

    @bgashler1
    ContributorAuthor

    Isidor Nikolic (@isidorn) FYI - this is the task I'll work on once your change is in Master. I'll put this on the June Milestone.

  3. added
    windows
    on May 18, 2016
  4. dstorey commented on Jun 14, 2016

    @dstorey
    Member

    There is also the -ms-highcontrast: active media feature for a less sledge hammer approach to fixing up HC issues in IE/Edge. super useful with CSS system colours to match the user chosen HC colour settings.

  5. bpasero commented on Jul 9, 2016

    @bpasero
    Contributor

    Brad Gashler (@bgashler1) can you please give +1/-1 that we can use this solution? I would like to get rid of the hacks we have for HC theme to solve #8516

    Imho it would be good to get rid of these special styles to clean up our CSS.

  6. 9 remaining items

  7. aeschli commented on Jul 14, 2016

    @aeschli
    Contributor

    Brad Gashler (@bgashler1) Not sure why you assigned this to me

  8. alexdima commented on Jul 14, 2016

    @alexdima
    Member

    Brad Gashler (@bgashler1) We are not doing anything special w.r.t. to switching to hc-dark when Windows goes into high-contrast mode. We always said that is the responsibility of the embedders of the editor.

  9. added a commit that references this issue on Jul 26, 2016
  10. bgashler1 commented on Jul 26, 2016

    @bgashler1
    ContributorAuthor

    alexandrudima feel free to move to August if the team would like (see my PR comment). I'd love to have auto-recognition of high-contrast theme. I think we can use a get CSS function to see if the -ms-high-contrast: active is present. If so, we should default to the high-contrast theme. This would benefit both web-embedded Monaco and in VS Code visually and accessibility-wise.

  11. isidorn commented on Jul 26, 2016

    @isidorn

    Moving to august since alexandrudima is on vacation and this is monaco editor related which releases do not have to be tied to our vscode releases

  12. added a commit that references this issue on Aug 16, 2016
  13. alexdima commented on Aug 16, 2016

    @alexdima
    Member

    PR merged. The automatic switching of the editor to the hc-black and the automatic detection of the high contrast mode in IE/Edge will be tracked in #10576

  14. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

accessibilitythemeswindows

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions