Skip to content

Commit

Permalink
Refine multiselect. (#19121)
Browse files Browse the repository at this point in the history
* Refine multiselect.

This restores the native selection in addition to the borders.

Additionally, it changes the cross-block selection border to also have a white outline.

* Refine colors, add dark theme exception.
  • Loading branch information
jasmussen authored Dec 13, 2019
1 parent 4786c14 commit 3687e8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/base-styles/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ $blue-medium-200: #bfe7f3;
$blue-medium-100: #e5f5fa;
$blue-medium-highlight: #b3e7fe;
$blue-medium-focus: #007cba;
$blue-medium-focus-dark: #fff;

// Alert colors.
$alert-yellow: #f0b849;
Expand Down
15 changes: 11 additions & 4 deletions packages/block-editor/src/components/block-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,16 @@
.block-editor-block-list__block.is-multi-selected {
// Show selection borders around every non-nested block's actual footprint.
> .block-editor-block-list__block-edit > [data-block] {
box-shadow: 0 0 0 2px #057cba;
box-shadow: 0 0 0 2px $blue-medium-focus;
border-radius: 1px;

// Windows High Contrast mode will show this outline.
outline: 2px solid transparent;

// Show a lighter blue for dark themes.
.is-dark-theme & {
box-shadow: 0 0 0 2px $blue-medium-focus-dark;
}
}
.block-editor-block-toolbar {
left: $border-width + $border-width + $block-padding;
Expand All @@ -195,9 +200,11 @@
margin-left: $block-padding;
}

// Hide the native selection marker once we select multiple blocks.
::selection {
background: transparent;
// Provide exceptions for placeholders.
.components-placeholder {
::selection {
background: transparent;
}
}
}

Expand Down

0 comments on commit 3687e8b

Please sign in to comment.