Skip to content

Commit

Permalink
Template Part block - add border states in editor. (#24498)
Browse files Browse the repository at this point in the history
* add border for selected, child selected, and hover states on template part block
  • Loading branch information
Addison-Stavlo authored Aug 20, 2020
1 parent d3d2a2d commit 8f57a1f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions packages/block-library/src/template-part/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,37 @@
box-shadow: 0 0 0 $border-width var(--wp-admin-theme-color);
}
}

.block-editor-block-list__block[data-type="core/template-part"] {
&.is-selected,
&.has-child-selected {
&::after {
top: $border-width;
bottom: $border-width;
left: $border-width;
right: $border-width;
border-radius: $radius-block-ui - $border-width; // Border is outset, so so subtract the width to achieve correct radius.
}
}

&.is-selected {
&::after {
// 2px outside.
box-shadow: 0 0 0 $border-width-focus var(--wp-admin-theme-color);
// Show a light color for dark themes.
.is-dark-theme & {
box-shadow: 0 0 0 $border-width-focus $dark-theme-focus;
}
}
}

&.has-child-selected {
&::after {
box-shadow: 0 0 0 $border-width $gray-200;

.is-dark-theme & {
box-shadow: 0 0 0 $border-width-focus $gray-700;
}
}
}
}

0 comments on commit 8f57a1f

Please sign in to comment.