Skip to content

Commit

Permalink
Fix dark menus in canvas, not in top toolbar (#22516)
Browse files Browse the repository at this point in the history
* Fix matrix popover style.

* Fix for replace flow.

* Fix alignment toolbars.

* Update snapshots.
  • Loading branch information
jasmussen authored Jun 8, 2020
1 parent bc51ec1 commit 8a6171f
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ export function BlockAlignmentMatrixToolbar( props ) {
const icon = <AlignmentMatrixControl.Icon value={ value } />;
const className = 'block-editor-block-alignment-matrix-toolbar';
const popoverClassName = `${ className }__popover`;
const isAlternate = true;

return (
<Dropdown
position="bottom right"
className={ className }
popoverProps={ { className: popoverClassName } }
popoverProps={ { className: popoverClassName, isAlternate } }
renderToggle={ ( { onToggle, isOpen } ) => {
const openOnArrowDown = ( event ) => {
if ( ! isOpen && event.keyCode === DOWN ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const DEFAULT_CONTROLS = [ 'left', 'center', 'right', 'wide', 'full' ];
const DEFAULT_CONTROL = 'center';
const WIDE_CONTROLS = [ 'wide', 'full' ];

const POPOVER_PROPS = {
isAlternate: true,
};

export function BlockAlignmentToolbar( {
value,
onChange,
Expand All @@ -63,6 +67,7 @@ export function BlockAlignmentToolbar( {

return (
<ToolbarGroup
popoverProps={ POPOVER_PROPS }
isCollapsed={ isCollapsed }
icon={
activeAlignmentControl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,10 @@ exports[`BlockAlignmentToolbar should match snapshot 1`] = `
}
isCollapsed={true}
label="Change alignment"
popoverProps={
Object {
"isAlternate": true,
}
}
/>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const BLOCK_ALIGNMENTS_CONTROLS = {
const DEFAULT_CONTROLS = [ 'top', 'center', 'bottom' ];
const DEFAULT_CONTROL = 'top';

const POPOVER_PROPS = {
isAlternate: true,
};

export function BlockVerticalAlignmentToolbar( {
value,
onChange,
Expand All @@ -49,6 +53,7 @@ export function BlockVerticalAlignmentToolbar( {

return (
<ToolbarGroup
popoverProps={ POPOVER_PROPS }
isCollapsed={ isCollapsed }
icon={
activeAlignment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,10 @@ exports[`BlockVerticalAlignmentToolbar should match snapshot 1`] = `
}
isCollapsed={true}
label="Change vertical alignment"
popoverProps={
Object {
"isAlternate": true,
}
}
/>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,13 @@ const MediaReplaceFlow = ( {
}
};

const POPOVER_PROPS = {
isAlternate: true,
};

return (
<Dropdown
popoverProps={ POPOVER_PROPS }
contentClassName="block-editor-media-replace-flow__options"
renderToggle={ ( { isOpen, onToggle } ) => (
<ToolbarGroup className="media-replace-flow">
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class Dropdown extends Component {
expandOnMobile={ expandOnMobile }
headerTitle={ headerTitle }
focusOnMount={ focusOnMount }
isAlternate
{ ...popoverProps }
className={ classnames(
'components-dropdown__content',
Expand Down

1 comment on commit 8a6171f

@alita-moore
Copy link
Contributor

Choose a reason for hiding this comment

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

I want to help make a README for this issue

Please sign in to comment.