Skip to content

Commit

Permalink
Clean up Gallery block move/remove UI (#16793)
Browse files Browse the repository at this point in the history
* Use larger buttons when we can.

* Avoid adding selected border to the caption section of the image.

* Remove hover/focus box shadows because they clash with the blue background.

* Revise method of specifying the .is-selected class.
  • Loading branch information
kjellr authored and gziolo committed Aug 29, 2019
1 parent ad18616 commit cd22f7b
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions packages/block-library/src/gallery/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ ul.wp-block-gallery {
outline: none;
}

.is-selected {
figure.is-selected {
outline: 4px solid theme(primary);
}

.is-transient img {
figure.is-transient img {
opacity: 0.3;
}

Expand Down Expand Up @@ -60,12 +60,30 @@ ul.wp-block-gallery {

.components-button {
color: $white;
padding: 2px;
width: $icon-button-size-small;
height: $icon-button-size-small;

// Remove hover/focus box shadows, since they clash with the blue background.
&:not(:disabled):not([aria-disabled="true"]):not(.is-default):hover,
&:focus:not(:disabled) {
box-shadow: none;
}

@include break-small() {
// Use smaller buttons to fit when there are many columns.
.columns-7 &,
.columns-8 & {
padding: 0;
width: inherit;
height: inherit;
}
}
}

.components-button:focus {
color: inherit;
}

}

.block-editor-rich-text figcaption {
Expand All @@ -80,13 +98,21 @@ ul.wp-block-gallery {

.block-library-gallery-item__move-menu,
.block-library-gallery-item__inline-menu {
padding: 2px;
padding: $grid-size-small;
display: inline-flex;
z-index: z-index(".block-library-gallery-item__inline-menu");

.components-button {
color: transparent;
}

@include break-small() {
// Use smaller buttons to fit when there are many columns.
.columns-7 &,
.columns-8 & {
padding: $grid-size-small / 2;
}
}
}

.block-library-gallery-item__inline-menu {
Expand Down

0 comments on commit cd22f7b

Please sign in to comment.