Skip to content

Commit

Permalink
Improve and simplify reusable block styles. (#18903)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZebulanStanphill authored Dec 5, 2019
1 parent bcfeae2 commit e3e2091
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 44 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 @@ -293,18 +293,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
5 changes: 5 additions & 0 deletions packages/block-library/src/block/edit-panel/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,8 @@
border-left-color: transparent;
}
}

.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
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 e3e2091

Please sign in to comment.