Skip to content

Commit

Permalink
Add block inspector to the Gutenberg playground. (#18077)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored and hypest committed Nov 4, 2019
1 parent be6a8fd commit 8d0e5aa
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions playground/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
BlockEditorKeyboardShortcuts,
BlockEditorProvider,
BlockList,
BlockInspector,
WritingFlow,
ObserveTyping,
} from '@wordpress/block-editor';
Expand Down Expand Up @@ -53,6 +54,9 @@ function App() {
onInput={ updateBlocks }
onChange={ updateBlocks }
>
<div className="playground__sidebar">
<BlockInspector />
</div>
<div className="editor-styles-wrapper">
<BlockEditorKeyboardShortcuts />
<WritingFlow>
Expand Down
23 changes: 23 additions & 0 deletions playground/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,33 @@
@import "./reset";
@import "./editor-styles";

$playground-header-height: 95px;

.playground__header {
align-items: center;
border-bottom: 1px solid #ddd;
display: flex;
justify-content: space-between;
padding: 20px;
height: $playground-header-height;
}

.playground__sidebar {
position: fixed;
top: $playground-header-height;
right: 0;
bottom: 0;
width: $sidebar-width;
border-left: $border-width solid $light-gray-500;
height: auto;
overflow: auto;
-webkit-overflow-scrolling: touch;

// Temporarily disable the sidebar on mobile
display: none;
@include break-small() {
display: block;
}
}

.playground__logo {
Expand All @@ -23,6 +43,9 @@
}

.playground__body {
@include break-small() {
width: calc(100% - #{$sidebar-width});
}
padding-top: 20px;

img {
Expand Down

0 comments on commit 8d0e5aa

Please sign in to comment.