Skip to content

Commit

Permalink
Improve and simplify reusable block styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZebulanStanphill committed Dec 4, 2019
1 parent 0480528 commit 180dfb9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 45 deletions.
12 changes: 2 additions & 10 deletions packages/block-editor/src/components/block-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -275,18 +275,10 @@
}

// Reusable blocks.
&.is-reusable > .block-editor-block-list__block-edit::before {
border: $border-width dashed $dark-opacity-light-500;

.is-dark-theme & {
border-color: $light-opacity-light-600;
}
}

&.is-reusable.is-selected > .block-editor-block-list__block-edit::before {
// Use opacity to work in various editor styles.
border-color: $dark-opacity-light-800;
border-left-color: transparent;
border-style: dashed;
border-width: $border-width;

.is-dark-theme & {
border-color: $light-opacity-light-800;
Expand Down
10 changes: 10 additions & 0 deletions packages/block-library/src/block/edit-panel/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,14 @@
border-color: $light-opacity-light-800;
border-left-color: transparent;
}

.is-navigate-mode & {
border-color: $blue-medium-focus;
border-left-color: transparent;
}
}

.editor-block-list__layout .is-selected.is-navigate-mode .reusable-block-edit-panel {
border-color: $blue-medium-focus;
border-left-color: transparent;
}
2 changes: 0 additions & 2 deletions packages/block-library/src/block/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { parse, serialize } from '@wordpress/blocks';
* Internal dependencies
*/
import ReusableBlockEditPanel from './edit-panel';
import ReusableBlockIndicator from './indicator';

class ReusableBlockEdit extends Component {
constructor( { reusableBlock } ) {
Expand Down Expand Up @@ -147,7 +146,6 @@ class ReusableBlockEdit extends Component {
onCancel={ this.stopEditing }
/>
) }
{ ! isSelected && ! isEditing && <ReusableBlockIndicator title={ reusableBlock.title } /> }
{ element }
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/block/editor.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.edit-post-visual-editor .block-library-block__reusable-block-container .block-editor-writing-flow__click-redirect {
height: auto;
min-height: auto;
}
12 changes: 0 additions & 12 deletions packages/block-library/src/block/indicator/editor.scss

This file was deleted.

19 changes: 0 additions & 19 deletions packages/block-library/src/block/indicator/index.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/block-library/src/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
* Import styles from internal editor components used by the blocks.
*/
@import "./block/edit-panel/editor.scss";
@import "./block/indicator/editor.scss";

/**
* Editor Normalization Styles
Expand Down

0 comments on commit 180dfb9

Please sign in to comment.