|
1 | 1 | .editor-block-list__layout .components-draggable__clone {
|
2 |
| - // Hide the Block UI when dragging the block |
3 |
| - // This ensures the page scroll properly (no sticky elements) |
| 2 | + // Hide the Block UI when dragging the block. |
| 3 | + // This ensures the page scroll properly (no sticky elements). |
4 | 4 | .editor-block-contextual-toolbar {
|
5 |
| - // I think important is fine here to avoid over complexing the selector |
| 5 | + // It's probably okay to use !important here to avoid over-complicating the selector. |
6 | 6 | display: none !important;
|
7 | 7 | }
|
8 | 8 | }
|
|
127 | 127 | }
|
128 | 128 | }
|
129 | 129 |
|
130 |
| - // Selected style |
| 130 | + // Selected style. |
131 | 131 | &.is-selected > .editor-block-list__block-edit::before {
|
132 | 132 | // Use opacity to work in various editor styles.
|
133 | 133 | outline: $border-width solid $dark-opacity-light-500;
|
|
137 | 137 | }
|
138 | 138 | }
|
139 | 139 |
|
140 |
| - // Hover style |
| 140 | + // Hover style. |
141 | 141 | &.is-hovered > .editor-block-list__block-edit::before {
|
142 | 142 | outline: $border-width solid theme(outlines);
|
143 | 143 | }
|
144 | 144 |
|
145 |
| - // Spotlight mode |
| 145 | + // Spotlight mode. |
146 | 146 | &.is-focus-mode:not(.is-multi-selected) {
|
147 | 147 | opacity: 0.5;
|
148 | 148 | transition: opacity 0.1s linear;
|
|
168 | 168 | background-color: $blue-medium-highlight;
|
169 | 169 | }
|
170 | 170 |
|
171 |
| - // selection style for multiple blocks |
| 171 | + // Selection style for multiple blocks. |
172 | 172 | &.is-multi-selected *::selection {
|
173 | 173 | background-color: transparent;
|
174 | 174 | }
|
|
179 | 179 | // Use opacity to work in various editor styles.
|
180 | 180 | mix-blend-mode: multiply;
|
181 | 181 |
|
182 |
| - // Collapse extra vertical padding on selection |
| 182 | + // Collapse extra vertical padding on selection. |
183 | 183 | top: -$block-padding;
|
184 | 184 | bottom: -$block-padding;
|
185 | 185 |
|
|
293 | 293 | margin-bottom: $border-width;
|
294 | 294 | }
|
295 | 295 |
|
296 |
| - // Hide all additional UI on floats. |
297 |
| - .editor-block-mover, |
298 |
| - .editor-block-list__block-mobile-toolbar { |
299 |
| - display: none; |
300 |
| - } |
301 |
| - |
302 | 296 | // Position toolbar better on mobile.
|
303 | 297 | .editor-block-contextual-toolbar {
|
304 | 298 | width: auto;
|
|
506 | 500 | .editor-block-list__block {
|
507 | 501 |
|
508 | 502 | // Left and right block settings and mover.
|
509 |
| - > .editor-block-mover { |
| 503 | + &.is-multi-selected > .editor-block-mover, |
| 504 | + > .editor-block-list__block-edit > .editor-block-mover { |
510 | 505 | position: absolute;
|
511 | 506 | width: $block-side-ui-width + $block-side-ui-clearance;
|
512 | 507 |
|
|
516 | 511 | }
|
517 | 512 |
|
518 | 513 | // Position depending on whether selected or not.
|
519 |
| - > .editor-block-mover { |
| 514 | + &.is-multi-selected > .editor-block-mover, |
| 515 | + > .editor-block-list__block-edit > .editor-block-mover { |
520 | 516 | top: -$block-padding - $border-width;
|
521 | 517 | }
|
522 | 518 |
|
|
526 | 522 | &.is-selected,
|
527 | 523 | &.is-hovered {
|
528 | 524 | .editor-block-mover {
|
529 |
| - z-index: z-index(".editor-block-list__block.is-{selected,hovered} .editor-block-{settings-menu,mover}"); |
| 525 | + z-index: z-index(".editor-block-list__block.is-{selected,hovered} .editor-block-mover"); |
530 | 526 | }
|
531 | 527 | }
|
532 | 528 | }
|
533 | 529 |
|
534 | 530 | // Left side UI.
|
535 |
| - > .editor-block-mover { |
| 531 | + &.is-multi-selected > .editor-block-mover, |
| 532 | + > .editor-block-list__block-edit > .editor-block-mover { |
536 | 533 | padding-right: $block-side-ui-clearance;
|
537 | 534 |
|
538 |
| - // Position for top level blocks |
539 |
| - left: -$block-side-ui-width - $block-side-ui-clearance; |
| 535 | + // Position for top level blocks. |
| 536 | + left: -$block-side-ui-width - $block-side-ui-clearance - $block-padding - $border-width; |
540 | 537 |
|
541 |
| - // Mobile |
| 538 | + // Hide on mobile, as mobile has a separate solution. |
542 | 539 | display: none;
|
543 | 540 | @include break-small() {
|
544 | 541 | display: block;
|
545 | 542 | }
|
546 | 543 | }
|
| 544 | + |
| 545 | + &.is-multi-selected > .editor-block-mover { |
| 546 | + left: -$block-side-ui-width - $block-side-ui-clearance; |
| 547 | + } |
| 548 | + |
| 549 | + // For floats, show block mover when block is selected, and never on hover. |
| 550 | + &[data-align="left"], |
| 551 | + &[data-align="right"] { |
| 552 | + // Show always when the block is selected. |
| 553 | + &.is-selected > .editor-block-list__block-edit > .editor-block-mover { |
| 554 | + // Don't show on mobile, allow the special mobile toolbar to work there. |
| 555 | + display: none; |
| 556 | + @include break-small() { |
| 557 | + display: block; |
| 558 | + opacity: 1; |
| 559 | + animation: none; |
| 560 | + |
| 561 | + // Make wider and taller to make "safe" hover area bigger. |
| 562 | + // The intent is to make it less likely that you hover float-adjacent |
| 563 | + // blocks that visually appear below the block. |
| 564 | + width: $block-side-ui-width + $block-side-ui-clearance + $block-padding + $border-width; |
| 565 | + height: auto; |
| 566 | + padding-bottom: $block-padding; |
| 567 | + |
| 568 | + // Unset the negative top margin, or it might overlap the block toolbar. |
| 569 | + margin-top: 0; |
| 570 | + } |
| 571 | + } |
| 572 | + |
| 573 | + // Don't show on hover, or on the "ghost" when dragging. |
| 574 | + &.is-hovered > .editor-block-list__block-edit > .editor-block-mover, |
| 575 | + &.is-dragging > .editor-block-list__block-edit > .editor-block-mover { |
| 576 | + display: none; |
| 577 | + } |
| 578 | + } |
547 | 579 | }
|
548 | 580 |
|
549 | 581 |
|
|
0 commit comments