Skip to content

Commit

Permalink
Merge pull request #3951 from WordPress/try/is-editing-focus
Browse files Browse the repository at this point in the history
Try adding focus outline for blocks that don't have input fields
  • Loading branch information
jasmussen committed Dec 13, 2017
2 parents b0fbe03 + 6234907 commit a9fcdfd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
5 changes: 0 additions & 5 deletions blocks/library/gallery/editor.scss
@@ -1,8 +1,3 @@
.wp-block-gallery:not( .components-placeholder ) {
margin-right: -16px;
margin-bottom: -16px;
}

.editor-block-list__block[data-type="core/gallery"] .editor-block-list__block-edit {
overflow: hidden;
}
Expand Down
6 changes: 5 additions & 1 deletion blocks/library/gallery/style.scss
@@ -1,3 +1,7 @@
.wp-block-gallery:not( .components-placeholder ) {
margin: -8px;
}

.wp-block-gallery,
.wp-block-gallery.alignleft,
.wp-block-gallery.alignright,
Expand All @@ -6,7 +10,7 @@
flex-wrap: wrap;

.blocks-gallery-image {
margin: 0 16px 16px 0;
margin: 8px;
display: flex;
flex-grow: 1;
flex-direction: column;
Expand Down
11 changes: 11 additions & 0 deletions editor/edit-post/modes/visual-editor/style.scss
Expand Up @@ -39,6 +39,17 @@
}
}

// This is a focus style shown for blocks that need an indicator even when in an isEditing state
// like for example an image block that receives arrowkey focus.
.editor-visual-editor .editor-block-list__block:not( .is-selected ) .editor-block-list__block-edit {
box-shadow: 0 0 0 0 $white, 0 0 0 0 $dark-gray-900;
transition: .1s box-shadow;

&:focus {
box-shadow: 0 0 0 1px $white, 0 0 0 3px $dark-gray-900;
}
}

.editor-visual-editor__inserter {
display: flex;
align-items: baseline;
Expand Down

0 comments on commit a9fcdfd

Please sign in to comment.