Skip to content

Commit

Permalink
Block Editor: Improve focus overlay and add global tag to breadcrumbs.
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras authored and noahtallen committed Mar 18, 2020
1 parent 61b6bac commit b31e3db
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
13 changes: 13 additions & 0 deletions packages/block-editor/src/components/block-title/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ export function BlockTitle( { name } ) {
return null;
}

// TODO: Infer this from `block.json` when we have block context.
// See https://github.com/WordPress/gutenberg/issues/19685.
if ( name === 'core/template-part' ) {
return (
<>
<span className="block-editor-block-title__global">
Global{ ' ' }
</span>
{ blockType.title }
</>
);
}

return blockType.title;
}

Expand Down
12 changes: 12 additions & 0 deletions packages/block-editor/src/components/block-title/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.block-editor-block-title__global {
align-items: center;
background: #000;
border-radius: 2px;
color: #fff;
display: inline-flex;
height: 18px;
justify-content: center;
margin: auto 5px;
padding: 0 4px;
width: 39px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
}

.block-editor-inner-blocks.is-controlled.is-selected {
box-shadow: 0 0 0 1600px rgba(0, 0, 0, 0.65);
box-shadow: 0 0 0 1600px rgba(200, 200, 200, 0.9);
padding: 1px 30px;
}
1 change: 1 addition & 0 deletions packages/block-editor/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
@import "./components/block-settings-menu/style.scss";
@import "./components/block-styles/style.scss";
@import "./components/block-switcher/style.scss";
@import "./components/block-title/style.scss";
@import "./components/block-types-list/style.scss";
@import "./components/block-variation-picker/style.scss";
@import "./components/button-block-appender/style.scss";
Expand Down

0 comments on commit b31e3db

Please sign in to comment.