-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Sites Management Page: Use <DropdownMenu />
core component
#66862
Sites Management Page: Use <DropdownMenu />
core component
#66862
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~1190 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the favoured component to use. One thing I don't like though is that the highlighter remained on the first menu item even when I hover other items, I think the highlighter should move to the item I hover.
Screen.Recording.2022-08-23.at.11.56.32.AM.mov
@vykes-mac Looks like there's an existing issue on the topic! WordPress/gutenberg#26401 It seems like there should be a blue hover state. Here's the Block Editor: CleanShot.2022-08-23.at.10.04.36.mp4It seems like we're missing the |
I see from the existing issue seems like the blue highlighter is for focus purposes only and the blue text is for hover. It would seem the |
The table is wider now that we're using a different component. Adding inset-inline-end: 18px;
position: relative; to the dropdown ( Also, adding padding-block: 0;
height: auto; on the button ( |
@zaguiini Oh, good eye. I missed that before. I've added a couple of tweaks with 989e791 and f116d3a Here's how it looks now:
@p-jackson Any good ideas on how to sort out this color mess? |
Yeah it is a bit of a mess 😮💨 Core button styles are defined here: https://github.com/WordPress/gutenberg/blob/8b9db3dc025f73e9dad9b076c6f14394b898a9b5/packages/components/src/button/style.scss#L19-L24 Over in Calypso we override the core styles in wp-calypso/client/assets/stylesheets/_wp-components-overrides.scss Lines 15 to 18 in 1455eef
That's where If it's a "primary" button it applies one set of styles. If it's a "secondary" button it applies a different set of styles. Same thing for "tertiary". But then that's it, it doesn't apply any other styles, so any other button variant doesn't get styled. I thought I'd just have to add a new override for whatever variant type the menu item is, but alas Does @Automattic/team-calypso-components have any advice? |
I've just pushed an override that fixes hover state just for our menu items. But now that I think of it, maybe we should add the styling for |
I'm not really familiar with all the style overrides in Calypso, but are all of them necessary at all? Can't Ideally, we should avoid overriding component styles as much as possible. Also, those classnames are not guaranteed to be public APIs, and relying on them is definitely prone to style breakage over time. We're soon going to the experiment with adding some (simple) theming options to components, which hopefully will remove the need for the majority of the style overrides |
That sounds great! My guess is the overrides are needed because the core components don't use enough variables. For example, rather than overriding the |
Definitely! Feel free to open a PR (or even just an issue) in core and tag @mirka and myself :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few changes but overall good to go!
Co-authored-by: Luis Felipe Zaguini <[email protected]>
Co-authored-by: Luis Felipe Zaguini <[email protected]>
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/7493951 Thank you @danielbachhuber for including a screenshot in the description! This is really helpful for our translators. |
Translation for this Pull Request has now been finished. |
Co-authored-by: Philip Jackson <[email protected]>
Fixes #66725
Proposed Changes
Uses the
<DropdownMenu />
core component instead of Calypso's<EllipsisMenu />
.The icon looks a little different than the original issue because P2 uses its own ellipsis icon and I opted to save bundle size by reusing an existing
<Gridicon />
.After
Before
Testing Instructions
/sites-dashboard
.