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 all 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
5 changes: 0 additions & 5 deletions components/popover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@
box-shadow: $shadow-popover;
border: 1px solid $light-gray-500;
background: $white;
width: calc( 100vw - 20px );

@include break-medium {
width: 300px;
}

.components-popover.is-top & {
bottom: 100%;
Expand Down
3 changes: 2 additions & 1 deletion editor/header/publish-dropdown/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.editor-publish-dropdown {
padding: 15px;
padding: 16px;
width: 300px;

.components-panel__body {
margin-left: -16px;
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
58 changes: 35 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 All @@ -71,6 +71,14 @@ input[type="search"].editor-inserter__search {
padding: 8px;
}

.editor-inserter__menu {
width: calc( 100vw - 20px );

@include break-medium {
width: 300px;
}
}

.editor-inserter__menu.components-popover.is-center .components-popover__content {
@media ( max-width: #{ $break-medium - 1 } ) {
border-width: 0;
Expand All @@ -89,17 +97,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 +121,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 +168,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