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

Move MoreMenu-specific styling away from Popover CSS #9069

Merged
merged 2 commits into from
Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions edit-post/components/header/more-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import { __, _x } from '@wordpress/i18n';
import { IconButton, Dropdown, MenuGroup } from '@wordpress/components';
import { Fragment } from '@wordpress/element';

/**
* Internal dependencies
Expand All @@ -17,6 +18,7 @@ import KeyboardShortcutsHelpMenuItem from '../keyboard-shortcuts-help-menu-item'
const MoreMenu = () => (
<Dropdown
className="edit-post-more-menu"
contentClassName="edit-post-more-menu__content"
position="bottom left"
renderToggle={ ( { isOpen, onToggle } ) => (
<IconButton
Expand All @@ -27,7 +29,7 @@ const MoreMenu = () => (
/>
) }
renderContent={ ( { onClose } ) => (
<div className="edit-post-more-menu__content">
<Fragment>
<ModeSwitcher onSelect={ onClose } />
<MenuGroup
label={ __( 'Settings' ) }
Expand All @@ -43,7 +45,7 @@ const MoreMenu = () => (
>
<KeyboardShortcutsHelpMenuItem onSelect={ onClose } />
</MenuGroup>
</div>
</Fragment>
) }
/>
);
Expand Down
10 changes: 9 additions & 1 deletion edit-post/components/header/more-menu/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@
}
}

.edit-post-more-menu__content {
.edit-post-more-menu__content .components-popover__content {
min-width: 260px;

// Let the menu scale to fit items.
@include break-mobile() {
width: auto;
max-width: $break-mobile;
}

.components-menu-group:not(:last-child),
> div:not(:last-child) .components-menu-group {
border-bottom: $border-width solid $light-gray-500;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports[`MoreMenu should match snapshot 1`] = `
<MoreMenu>
<Dropdown
className="edit-post-more-menu"
contentClassName="edit-post-more-menu__content"
position="bottom left"
renderContent={[Function]}
renderToggle={[Function]}
Expand Down
7 changes: 0 additions & 7 deletions packages/components/src/popover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,6 @@ $arrow-size: 8px;
position: absolute;
height: auto;
overflow-y: auto;

// Let the menu scale to fit items.
min-width: 260px;
@include break-mobile() {
width: auto;
max-width: $break-mobile;
}
}

.components-popover:not(.is-mobile).is-top & {
Expand Down