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

Update custom menu styles #149187

Merged
merged 20 commits into from
May 17, 2022
Merged

Update custom menu styles #149187

merged 20 commits into from
May 17, 2022

Conversation

daviddossett
Copy link
Contributor

@daviddossett daviddossett commented May 10, 2022

This PR fixes #148587 by updating the following menu styles:

  • Background color on default dark and base dark theme for better separation
  • Foreground color on base dark theme for better contrast
  • 100% width separators with updated colors
  • Slight increase in item height
  • Border radius on context menu
  • Removes 1px border from items

To do:

  • Fix focus border jank on hc themes (@sbatten I'm attempting to use an existing rule that addressed this only for HC themes, but using :host-context doesn't seem to have any effect here.

Before

CleanShot 2022-05-10 at 13 45 36@2x

CleanShot 2022-05-10 at 13 45 26@2x

After

CleanShot 2022-05-11 at 16 15 52@2x

CleanShot 2022-05-11 at 16 16 08@2x

@daviddossett daviddossett added this to the May 2022 milestone May 10, 2022
@daviddossett daviddossett self-assigned this May 10, 2022
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.

Overall, the new styling is looking really slick 👌 just need to fine-tune the color tokens and ensure it doesn't break existing themes

extensions/theme-defaults/themes/dark_vs.json Outdated Show resolved Hide resolved
src/vs/platform/theme/common/colorRegistry.ts Outdated Show resolved Hide resolved
miguelsolorio
miguelsolorio previously approved these changes May 11, 2022
@sbatten
Copy link
Member

sbatten commented May 12, 2022

There is a problem with the corners
image

You can see the rounded corner, then a sharp corner, then the shadows

@sbatten
Copy link
Member

sbatten commented May 12, 2022

Are you intentionally making the keyboard shortcuts use disabled styling when not focused?
image

@sbatten
Copy link
Member

sbatten commented May 12, 2022

High contrast separator margins are not consistent with other themes
image

Copy link
Member

@sbatten sbatten left a comment

Choose a reason for hiding this comment

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

Can you clarify the todo above?

We should match the menu rounded corners in the menubar buttons as well. This is notepad in win11
image

How did we choose the corner radius? On windows 11, I find the native UI a lot more round, which maybe we could match?

@daviddossett
Copy link
Contributor Author

daviddossett commented May 12, 2022

Can you clarify the todo above?

This rule prevented the behavior in the gif below. A side effect of that rule was a that it rendered an unwanted thin border around all menu items on any theme. I'm trying to scope it to only hc themes like this to prevent the focus outline janking the layout around, but it doesn't seem to work. Could use your input here.

CleanShot 2022-05-12 at 08 29 09

How did we choose the corner radius? On windows 11, I find the native UI a lot more round, which maybe we could match?

It's roughly similar to what we use for our icon buttons. I'll take a closer look at Win 11 for inspiration. Will also look at the menu buttons themselves.

Are you intentionally making the keyboard shortcuts use disabled styling when not focused?

They are using descriptionForeground to be less prominent on purpose. Looks like not every theme maintains great contrast though, so I'll see what I can do. Will fix the hc separator padding as well.

@daviddossett
Copy link
Contributor Author

daviddossett commented May 12, 2022

Many thanks to @sbatten for helping our with the high contrast layout shift fix 🙏

I also fixed the following:

  • Border radius applies to all themes and matches icon button @ 5px
  • Box shadow respects border-radius
  • Separators maintain correct width and margin/padding
  • Shortcut uses opacity value to appear less prominent unless parent irem is hovered/focused
CleanShot.2022-05-12.at.11.54.47.mp4

jrieken
jrieken previously approved these changes May 13, 2022
sbatten
sbatten previously approved these changes May 17, 2022
@daviddossett daviddossett merged commit 5f3e9c1 into main May 17, 2022
@daviddossett daviddossett deleted the ddossett/custom-menu-styles branch May 17, 2022 01:40
Mingpan pushed a commit to Mingpan/vscode that referenced this pull request May 23, 2022
* Initial updates

* Add border radius

* Address PR feedback

* Fix typo

* Update shadow blur

* Update LR padding and use description foreground for shortcuts

* Typo

* Fix separator padding/margin

* fix jumpy items in hc themes

* Fix shadow and border radius

* Use opacity for keybinding for better color blend

* Update min width and container padding T/B

* Revert actionbar margin and remove unnecessary menu css file

* Ensure menus respect 0 horizontal margin rule

* set bg/fg color on menu container

* better fix for jumpy menu items

* use outline instead of border

* clean up dead css in style.css
fix opacity for separators in menus

* bring back vertical action bar margins

* Remove old CSS import

Co-authored-by: SteVen Batten <sbatten@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Jul 1, 2022
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.

Custom menu blends in with various background
4 participants