Skip to content

Commit

Permalink
fix selected but not focused state
Browse files Browse the repository at this point in the history
  • Loading branch information
Addison-Stavlo committed Jan 15, 2021
1 parent 4611b99 commit f6ad445
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/block-library/src/template-part/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,35 @@

// Ensures a border is present when a child block is selected.
.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.
box-shadow: 0 0 0 $border-width var(--wp-admin-theme-color);
}
}

&.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 var(--wp-admin-theme-color);

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

0 comments on commit f6ad445

Please sign in to comment.