Skip to content

Commit

Permalink
Polish dropdown arrow. Now it's the same as for switcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joen Asmussen committed Sep 13, 2018
1 parent 6d92309 commit c933243
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
13 changes: 13 additions & 0 deletions edit-post/assets/stylesheets/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,16 @@
text-align: center;
font-size: $default-font-size;
}

@mixin dropdown-arrow() {
content: "";
pointer-events: none;
display: block;
position: absolute;
width: 0;
height: 0;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
border-top: 5px solid currentColor;
right: 6px;
}
3 changes: 1 addition & 2 deletions packages/components/src/dropdown-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { DOWN } from '@wordpress/keycodes';
* Internal dependencies
*/
import IconButton from '../icon-button';
import Dashicon from '../dashicon';
import Dropdown from '../dropdown';
import { NavigableMenu } from '../navigable-container';

Expand Down Expand Up @@ -61,7 +60,7 @@ function DropdownMenu( {
label={ label }
tooltip={ label }
>
<Dashicon icon="arrow-down" />
<span className="components-dropdown-menu__indicator" />
</IconButton>
);
} }
Expand Down
16 changes: 11 additions & 5 deletions packages/components/src/dropdown-menu/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@
background-color: $dark-gray-500;
color: $white;
}

.components-dropdown-menu__indicator {
display: inline-block;
margin-left: 10px;

// Add a dropdown arrow indicator.
&::after {
@include dropdown-arrow();
top: $icon-button-size-small / 2 + 1px;
}
}
}
}
.components-dropdown-menu__popover .components-popover__content {
Expand All @@ -58,11 +69,6 @@
outline: none;
cursor: pointer;

.dashicon {
margin-right: 8px;
}


&.has-separator {
margin-top: 6px;
position: relative;
Expand Down
11 changes: 1 addition & 10 deletions packages/editor/src/components/block-switcher/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,8 @@

// Add a dropdown arrow indicator.
.editor-block-icon::after {
content: "";
pointer-events: none;
display: block;
position: absolute;
@include dropdown-arrow();
top: $icon-button-size-small / 2 - 1px;
width: 0;
height: 0;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
border-top: 5px solid currentColor;
right: 6px;
}

.editor-block-switcher__transform {
Expand Down

0 comments on commit c933243

Please sign in to comment.