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

Minor style updates #60304

Merged
merged 13 commits into from Oct 29, 2018
Merged

Minor style updates #60304

merged 13 commits into from Oct 29, 2018

Conversation

infinnie
Copy link
Contributor

@infinnie infinnie commented Oct 9, 2018

Update to #60288. Sorry for the wrong author name in the initial pull request.

Screenshot: image

(Custom color settings below)

{
    "workbench.colorTheme": "Visual Studio Light",
    "workbench.colorCustomizations": {
        "menu.selectionBackground": "#eeeeee",
        "menu.selectionForeground": "#222222",
        "widget.shadow": "#00000033"
    }
}

@infinnie
Copy link
Contributor Author

infinnie commented Oct 11, 2018

This also fixes #52854 (comment)

@@ -53,6 +53,14 @@
line-height: 1;
}

.monaco-menu .monaco-action-bar.vertical .keybinding {
opacity: 0.55;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't apply in high contrast mode

@@ -124,6 +132,8 @@

.monaco-menu .monaco-action-bar.vertical .action-item {
border: 1px solid transparent; /* prevents jumping behaviour on hover or focus */
border-left: 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this introduces jumping behavior, please remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The jumping in High Contrast mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jumping behavior has been fixed.

@@ -79,7 +79,7 @@
}

.monaco-shell .monaco-menu .monaco-action-bar.vertical .action-menu-item {
height: 1.8em;
height: 2em;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think we should increase the size of the menu items

Copy link
Contributor

@miguelsolorio miguelsolorio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This opacity change doesn't pass the color contrast ratio (4.5:1) in either of our default dark and light themes:

Light Dark
image image

Please ensure that the opacity change passes the color contrast ratio

@infinnie
Copy link
Contributor Author

@misolori this would not be shipped in high contrast mode.

@miguelsolorio
Copy link
Contributor

miguelsolorio commented Oct 15, 2018

@infinnie the color contrast ratio has to pass on our default themes (light, dark and high contrast), so it still applies in this instance for light & dark.

@infinnie
Copy link
Contributor Author

@misolori Maybe what is needed is that we should use a darker color for menu text.

@miguelsolorio
Copy link
Contributor

@infinnie we use the global foreground color for most of our text, I don't think we'd want to introduce a separate color just for the menu, especially since it's only to use a lighter color shortcut for the keyboard shortcuts.

Since the menu is on a white background, the lightest color you can go with is #757575, so you'd need to get your opacity color to get close to that in order to pass the color contrast ratio (and double-check the dark theme). That would look like this (not sure if that's worth the effort):

image

@usernamehw
Copy link
Contributor

Can't it have ratio less than 4.5:1 but using good contrast (maybe even the same color as text) on hover/focus?

Those tooltips are the secondary info, 99.9% of the time people don't care about them.

@miguelsolorio
Copy link
Contributor

@usernamehw regardless of importance, all text must be accessible. The WCAG 2 requirements for contrast state that all text must pass a minimum contrast of 4.5:1

@infinnie
Copy link
Contributor Author

infinnie commented Oct 17, 2018

Even currently, text such as that in disabled menu items does not pass the test. Maybe we should do something to improve contrast for disabled menu items first.

@miguelsolorio
Copy link
Contributor

Disabled/Inactive items are part of the exception:

WCAG 2.0 defines four types of "incidental" text that are not required to meet the contrast requirements.

Inactive: An inactive element, like a disabled Submit button, is identified visually by its lower-contrast state.

@infinnie
Copy link
Contributor Author

infinnie commented Oct 17, 2018

image

Even Microsoft Edge does not pass that color contrast ratio check!

@infinnie
Copy link
Contributor Author

infinnie commented Oct 17, 2018

Visual Studio Code’s own TypeScript plugin uses an opacity for unused variables too small to pass the color contrast ratio check. Maybe this should be changed first.

Many color themes also do not provide enough color contrast for certain types of tokens like comments.

@miguelsolorio
Copy link
Contributor

miguelsolorio commented Oct 17, 2018

@infinnie While I would encourage you to file bugs against those items, I'd suggest to keep this conversation on-topic for this PR.

@infinnie
Copy link
Contributor Author

infinnie commented Oct 17, 2018

OK, the aforementioned problem has been fixed in my previous commit.

@infinnie
Copy link
Contributor Author

@misolori this is what it looks like now:
image

@@ -122,7 +122,7 @@ export const TAB_ACTIVE_FOREGROUND = registerColor('tab.activeForeground', {

export const TAB_INACTIVE_FOREGROUND = registerColor('tab.inactiveForeground', {
dark: transparent(TAB_ACTIVE_FOREGROUND, 0.5),
light: transparent(TAB_ACTIVE_FOREGROUND, 0.5),
light: transparent(TAB_ACTIVE_FOREGROUND, 0.7),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't add fixes for issues not related to this PR (menu styling). Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I would edit that in another branch later.

@miguelsolorio miguelsolorio self-assigned this Oct 22, 2018
@miguelsolorio
Copy link
Contributor

After discussing this with the team internally, the consensus is we'd be happy to introduce a new theme color for keybinding text that would allow theme authors to style that property. However, we would not update our default themes since the native menus do not use this style:

image

So if you'd like, you can update your PR to reflect this change or @sbatten can do it on our end.

@infinnie
Copy link
Contributor Author

@misolori I guess a better option is that one could configure the opacity of the keyboard shortcuts instead of the color. This would work better if he or she were to switch from a dark theme to a light one or vice versa.

@miguelsolorio
Copy link
Contributor

miguelsolorio commented Oct 24, 2018

@infinnie I think by default this inherits the menu foreground color so they wouldn't have to worry about it. Also, you can control the opacity of the color by utilizing the 8 digit hex color (#RRGGBBAA). So #FF000010 #FF00001A would render #FF0000 at 10% opacity.

@usernamehw
Copy link
Contributor

Isn't 10% - 1A in hex?

@miguelsolorio
Copy link
Contributor

@infinnie sorry, you're right.

@infinnie
Copy link
Contributor Author

@misolori you mentioned the wrong person.

@sbatten
Copy link
Member

sbatten commented Oct 29, 2018

@infinnie Thanks for the PR. I have made some updates as I wanted to merge the PR this iteration and you have a good fix for #61564. If you want to revisit some of the other changes that I removed, feel free to open another PR.

@sbatten sbatten merged commit a14b154 into microsoft:master Oct 29, 2018
@sbatten sbatten added this to the October 2018 milestone Oct 29, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants