Skip to content

Commit

Permalink
Try: Nicer block footprint for social links. (#20978)
Browse files Browse the repository at this point in the history
* Try: Nicer block footprint for social links.

* Address feedback
  • Loading branch information
jasmussen authored Mar 18, 2020
1 parent 8c13651 commit 6f63dc3
Showing 1 changed file with 7 additions and 31 deletions.
38 changes: 7 additions & 31 deletions packages/block-library/src/social-links/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,10 @@
// @todo: eventually we may add a feature that lets a parent container absorb the block UI of a child block.
// When that happens, leverage that instead of the following overrides.
[data-type="core/social-links"] {
// 1. Reset margins on immediate innerblocks container.
.wp-block-social-links > .block-editor-inner-blocks > .block-editor-block-list__layout {
margin-left: 0;
margin-right: 0;
}

// 2. Remove paddings on subsequent immediate children.
.wp-block-social-links > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block {
width: auto;
padding-left: 0;
padding-right: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
margin-bottom: 0;
}

// 3. Minimize the block outlines.
.wp-block-social-links > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block::before {
border-right: none;
border-top: none;
border-bottom: none;
}

// 4. Remove the dashed outlines for child blocks.
&.is-selected .wp-block-social-links .block-editor-block-list__block::before,
&.has-child-selected .wp-block-social-links .block-editor-block-list__block::before {
border-color: transparent !important; // !important used to keep the selector from growing any more complex.
}

// Hide the mover.
// Hide the sibling inserter.
.wp-block-social-links .block-editor-block-list__insertion-point { // Needs specificity.
display: none;
}
}

// Polish the Appender.
Expand Down Expand Up @@ -114,3 +83,10 @@
// Windows High Contrast mode will show this outline, but not the box-shadow.
outline: 2px solid transparent;
}

// To ensure a better selection footprint when editing, attach the margin to the block container.
// @todo: This can very probably be removed entirely when this block receives a lighter DOM.
.is-navigate-mode .block-editor-block-list__layout .block-editor-block-list__block[data-type="core/social-link"].is-selected::after,
.block-editor-block-list__layout .block-editor-block-list__block[data-type="core/social-link"]:not([contenteditable]):focus::after {
right: 8px;
}

0 comments on commit 6f63dc3

Please sign in to comment.