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

Restore the block hover and focus styles in Unified Toolbar mode. #11737

Merged
merged 2 commits into from
Nov 19, 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
2 changes: 1 addition & 1 deletion packages/editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ export class BlockListBlock extends Component {
// Empty paragraph blocks should always show up as unselected.
const showEmptyBlockSideInserter = ( isSelected || isHovered ) && isEmptyDefaultBlock && isValid;
const showSideInserter = ( isSelected || isHovered ) && isEmptyDefaultBlock;
const shouldAppearSelected = ! isFocusMode && ! hasFixedToolbar && ! showSideInserter && isSelected && ! isTypingWithinBlock;
const shouldAppearSelected = ! isFocusMode && ! showSideInserter && isSelected && ! isTypingWithinBlock;
const shouldAppearHovered = ! isFocusMode && ! hasFixedToolbar && isHovered && ! isEmptyDefaultBlock;
// We render block movers and block settings to keep them tabbale even if hidden
const shouldRenderMovers = ! isFocusMode && ( isSelected || hoverArea === 'left' ) && ! showEmptyBlockSideInserter && ! isMultiSelecting && ! isPartOfMultiSelection && ! isTypingWithinBlock;
Expand Down
14 changes: 3 additions & 11 deletions packages/editor/src/components/block-list/breadcrumb.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* External dependencies
*/
import classnames from 'classnames';

/**
* WordPress dependencies
*/
Expand Down Expand Up @@ -53,12 +48,10 @@ export class BlockBreadcrumb extends Component {
}

render() {
const { clientId, rootClientId, isLight } = this.props;
const { clientId, rootClientId } = this.props;

return (
<div className={ classnames( 'editor-block-list__breadcrumb', {
'is-light': isLight,
} ) }>
<div className={ 'editor-block-list__breadcrumb' }>
<Toolbar>
{ rootClientId && (
<Fragment>
Expand All @@ -75,12 +68,11 @@ export class BlockBreadcrumb extends Component {

export default compose( [
withSelect( ( select, ownProps ) => {
const { getBlockRootClientId, getEditorSettings } = select( 'core/editor' );
const { getBlockRootClientId } = select( 'core/editor' );
const { clientId } = ownProps;

return {
rootClientId: getBlockRootClientId( clientId ),
isLight: getEditorSettings().hasFixedToolbar,
};
} ),
] )( BlockBreadcrumb );
5 changes: 0 additions & 5 deletions packages/editor/src/components/block-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -908,11 +908,6 @@
}
}

&.is-light .components-toolbar {
background: rgba($white, 0.5);
color: $dark-gray-700;
}

// Position the breadcrumb closer on mobile.
[data-align="left"] &,
[data-align="right"] & {
Expand Down
4 changes: 3 additions & 1 deletion packages/editor/src/components/post-title/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
}

&:not(.is-focus-mode):not(.has-fixed-toolbar) {
&:not(.is-focus-mode) {
&.is-selected .editor-post-title__input {
// use opacity to work in various editor styles
border-color: $dark-opacity-light-500;
Expand All @@ -56,7 +56,9 @@
border-color: $light-opacity-light-500;
}
}
}

&:not(.is-focus-mode):not(.has-fixed-toolbar) {
.editor-post-title__input:hover {
border-color: theme(outlines);
}
Expand Down