Skip to content

Commit

Permalink
Add style for appender drop target
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jan 10, 2020
1 parent 3868c40 commit 9d3667b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function BlockListAppender( {
renderAppender: CustomAppender,
} ) {
const ref = useRef();
const { position } = useBlockDropZone( {
const { isDraggingOverElement } = useBlockDropZone( {
element: ref,
rootClientId,
} );
Expand Down Expand Up @@ -79,8 +79,7 @@ function BlockListAppender( {
onFocus={ stopPropagation }
ref={ ref }
className={ classnames( 'block-list-appender', {
'is-dragging-close-to-top': position && position.y === 'top',
'is-dragging-close-to-bottom': position && position.y === 'bottom',
'is-dragging-over': isDraggingOverElement,
} ) }
>
{ appender }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
}
}

.block-list-appender.is-dragging-over > div::before {
content: "";
position: absolute;
right: -$block-padding;
left: -$block-padding;
top: -$block-padding;
bottom: -$block-padding;
border: 3px solid theme(primary);
}

.block-list-appender > .block-editor-inserter {
display: block;
}

0 comments on commit 9d3667b

Please sign in to comment.