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

fix(options-menu, dropdown): normalized plain toggle size #3878

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

mcoker
Copy link
Contributor

@mcoker mcoker commented Feb 22, 2021

This makes the plain toggles match the plain button size.

fixes #3437

@patternfly-build
Copy link

patternfly-build commented Feb 22, 2021

Preview: https://patternfly-pr-3878.surge.sh

CSS Size Report
NameCurrentPreviousDiff %
components/ContextSelector/context-selector.css8.9 kB8.9 kB-0.02
components/Dropdown/dropdown.css22.7 kB22.3 kB1.37
components/OptionsMenu/options-menu.css13.5 kB13.1 kB3.15
patternfly-no-reset.css1.1 MB1.1 MB0.07
patternfly.css1.1 MB1.1 MB0.07
patternfly.min.css957.7 kB957.1 kB0.07

A11y report: https://patternfly-pr-3878-coverage.surge.sh

Copy link
Member

@evwilkin evwilkin left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

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

Ah, the toolbar!

@@ -6,7 +6,7 @@ $pf-c-dropdown--breakpoint-map: build-breakpoint-map("base", "sm", "md", "lg", "
--pf-c-dropdown__toggle--PaddingRight: var(--pf-global--spacer--sm);
--pf-c-dropdown__toggle--PaddingBottom: var(--pf-global--spacer--form-element);
--pf-c-dropdown__toggle--PaddingLeft: var(--pf-global--spacer--sm);
--pf-c-dropdown__toggle--MinWidth: var(--pf-global--target-size--MinWidth);
--pf-c-dropdown__toggle--MinWidth: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you need to keep the var(--pf-global--target-size--MinWidth); value as the button is the correct height now, but narrower than before.

Screen Shot 2021-03-02 at 8 43 56 AM

The toolbar spacing issue seems to be a result of a misconfiguration in the toolbar demos. Right now, these buttons are part of an overflow menu whereas they should just be in an toolbar icon group.

Screen Shot 2021-03-02 at 8 54 24 AM

To correct, we could A) move the overflow menu with the kebab into the icon button group, B) negative margin an overflow menu that appears next to an icon button group or C) use the built in margining to space the overflow menu. I think I'd most support option B, as it seems to be the most flexible solution. Because the icon buttons pf-m-plain their padding provides the expected visual spacing, but that may cause and issue when they're a sibling to any other button when it is exposed from an overflow menu.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like you need to keep the var(--pf-global--target-size--MinWidth); value as the button is the correct height now, but narrower than before.

I think that's OK, this update basically just updates the plain toggles to match the plain button sizes, so if you have a plain button and a plain dropdown toggle, they'll be the same size in react anyways since our FA icons are a variable width. To make them the same in core, I think all of the plain actions (buttons/toggles) would need some sort of min-width - even then you'd have some variation since some core icons are wider than they are tall.

Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

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

WFM, LAPTM! 🌮

@mattnolting mattnolting merged commit e03620c into patternfly:master Mar 2, 2021
@redallen
Copy link
Contributor

redallen commented Mar 2, 2021

🎉 This PR is included in version 4.89.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kebab has more built in padding than other toolbar icons
5 participants