Skip to content

Commit

Permalink
Merge pull request #492 from WordPress/update/switcher-styles
Browse files Browse the repository at this point in the history
Polish the block switcher styles
  • Loading branch information
jasmussen committed Apr 24, 2017
2 parents 6f0376f + e4ac5a3 commit 9511797
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 32 deletions.
3 changes: 3 additions & 0 deletions blocks/components/editable/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.blocks-editable {
position: relative;
z-index: -1;

> p:first-child {
margin-top: 0;
}
Expand Down
1 change: 0 additions & 1 deletion editor/components/block-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class BlockSwitcher extends wp.element.Component {
</IconButton>
{ this.state.open &&
<div className="editor-block-switcher__menu">
<div className="editor-block-switcher__menu-arrow" />
{ allowedBlocks.map( ( { slug, title, icon } ) => (
<IconButton
key={ slug }
Expand Down
41 changes: 10 additions & 31 deletions editor/components/block-switcher/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
.editor-block-switcher__toggle {
width: auto;
margin: 3px;
padding: 6px;
}

.editor-block-switcher__arrow {
Expand All @@ -25,11 +26,16 @@
border-bottom: none;
border-left-color: transparent;
border-right-color: transparent;

.editor-block-switcher__toggle:hover & {
border-top-color: $blue-medium;
}
}

.editor-block-switcher__menu {
position: absolute;
top: 50px;
top: 43px;
margin-left: -1px;
box-shadow: 0px 3px 20px rgba( 18, 24, 30, .1 ), 0px 1px 3px rgba( 18, 24, 30, .1 );
border: 1px solid #e0e5e9;
background: #fff;
Expand All @@ -40,35 +46,6 @@
}
}

.editor-block-switcher__menu-arrow {
border: 10px dashed $light-gray-500;
height: 0;
line-height: 0;
position: absolute;
width: 0;
z-index: 1;
top: -10px;
left: 50%;
margin-left: -10px;
border-bottom-style: solid;
border-top: none;
border-left-color: transparent;
border-right-color: transparent;

&:before {
top: 2px;
border: 10px solid $white;
content: " ";
position: absolute;
left: 50%;
margin-left: -10px;
border-bottom-style: solid;
border-top: none;
border-left-color: transparent;
border-right-color: transparent;
}
}

.editor-block-switcher__menu-item {
width: auto;
margin: 3px;
Expand All @@ -79,7 +56,9 @@
color: $dark-gray-500;
cursor: pointer;

&:hover {
&:hover,
&:not(:disabled):hover {
color: $dark-gray-500;
border-color: $dark-gray-500;
}

Expand Down

0 comments on commit 9511797

Please sign in to comment.