Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve inserter style #3080

Merged
merged 5 commits into from
Oct 24, 2017
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/popover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
width: calc( 100vw - 20px );

@include break-medium {
width: 300px;
width: 320px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed for all popovers or should apply only to the inserter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point. I moved the width stuff around to better spots. Had to also give a width to the publish dropdown now as it inherited teh width from here.

screen shot 2017-10-21 at 09 43 33

}

.components-popover.is-top & {
Expand Down
12 changes: 6 additions & 6 deletions editor/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,6 @@ export class InserterMenu extends Component {
onClick={ this.setSearchFocus }
ref={ this.bindReferenceNode( 'search' ) }
/>
<div role="menu" className="editor-inserter__content"
ref={ ( ref ) => this.tabContainer = ref }>
{ isShowingRecent && this.renderBlocks( this.props.recentlyUsedBlocks ) }
{ isShowingEmbeds && this.renderBlocks( visibleBlocksByCategory.embed ) }
{ ! isShowingRecent && ! isShowingEmbeds && this.renderCategories( visibleBlocksByCategory ) }
</div>
{ ! isSearching &&
<div className="editor-inserter__tabs is-recent">
<button
Expand All @@ -391,6 +385,12 @@ export class InserterMenu extends Component {
</button>
</div>
}
<div role="menu" className="editor-inserter__content"
ref={ ( ref ) => this.tabContainer = ref }>
{ isShowingRecent && this.renderBlocks( this.props.recentlyUsedBlocks ) }
{ isShowingEmbeds && this.renderBlocks( visibleBlocksByCategory.embed ) }
{ ! isShowingRecent && ! isShowingEmbeds && this.renderCategories( visibleBlocksByCategory ) }
</div>
</div>
);
}
Expand Down
50 changes: 27 additions & 23 deletions editor/inserter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
height: calc( 100vh - #{ $admin-bar-height-big + $header-height + 34 + $inserter-tabs-height } ); // 34 = search input height

@include break-medium {
height: 240px;
height: 260px;
}

overflow: auto;
Expand All @@ -53,11 +53,11 @@ input[type="search"].editor-inserter__search {
margin: 0;
box-shadow: none;
border: 1px solid transparent;
border-bottom: 1px solid $light-gray-500;
padding: 8px 11px;
font-size: $default-font-size;
position: relative;
z-index: 1;
border-bottom: 1px solid $light-gray-500;

&:focus {
outline: none;
Expand Down Expand Up @@ -89,17 +89,19 @@ input[type="search"].editor-inserter__search {

.editor-inserter__block {
display: flex;
width: 50%;
flex-direction: column;
width: calc( 50% - 16px );
border-radius: 4px;
font-size: $default-font-size;
color: $dark-gray-500;
margin: 0;
padding: 12px 6px;
margin: 8px;
padding: 12px 6px 6px 6px;
align-items: center;
cursor: pointer;
border: none;
background: none;
line-height: 20px;

background: transparent;
border: 1px solid transparent;

&:disabled {
opacity: 0.6;
Expand All @@ -111,45 +113,45 @@ input[type="search"].editor-inserter__search {
color: $blue-medium-500;
}

&:focus {
outline: 1px solid $dark-gray-500;
}

&:focus,
&:active,
&.is-active {
background: $dark-gray-500;
outline: none;
border: 1px solid $dark-gray-500;
box-shadow: inset 0 0 0 1px $white;
color: $dark-gray-900;
background: $light-gray-300;
position: relative;
color: $white;
}
}

.dashicon {
margin-right: 8px;
}
}

.editor-inserter__separator {
border-top: 1px solid $light-gray-500;
background: rgba( $white, .8 );
text-align: center;
display: block;
margin: 0;
padding: 12px 14px 0 14px;
font-size: $default-font-size;
font-weight: 600;
margin-top: -1px; // hide the first top border
}

.editor-inserter__tabs {
width: 100%;
display: flex;
justify-content: space-between;
position: relative;
z-index: z-index( '.editor-inserter__tabs' );
background: $light-gray-300;
border-bottom: 1px solid $light-gray-500;
}

.editor-inserter__tab {
background: $light-gray-300;
border: none;
border-bottom: 2px solid transparent;
border-top: 2px solid transparent;
box-shadow: 0 0 0 1px $light-gray-500;
background: none;
border-bottom: 3px solid transparent;
border-top: 3px solid transparent;
font-size: $default-font;
padding: 8px 8px;
width: 100%;
Expand All @@ -158,13 +160,15 @@ input[type="search"].editor-inserter__search {
cursor: pointer;

&.is-active {
background: $white;
font-weight: 600;
border-bottom-color: $blue-medium-500;
position: relative;
z-index: z-index( '.editor-inserter__tab.is-active' );
}

&:active,
&:focus {
z-index: z-index( '.editor-inserter__tab.is-active' );
box-shadow: $button-focus-style;
outline: none;
}
Expand Down
7 changes: 4 additions & 3 deletions editor/modes/visual-editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -370,17 +370,18 @@
}

> .editor-inserter__block {
flex-direction: row;
opacity: 0;
transition: opacity 150ms;
margin: 0 10px;
width: auto;
font-family: $default-font;
font-size: $default-font-size;
box-shadow: none;
padding: 6px;

&:active {
background: none;
color: $blue-medium-500;
.dashicon {
margin-right: 8px;
}
}

Expand Down