Skip to content

Commit

Permalink
Try a different approach for styling movers
Browse files Browse the repository at this point in the history
  • Loading branch information
Joen Asmussen committed Jan 16, 2018
1 parent db533fa commit adbdbb7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
1 change: 1 addition & 0 deletions components/dashicon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,7 @@ export default class Dashicon extends wp.element.Component {

return (
<svg
tabindex="-1"
aria-hidden
role="img"
focusable="false"
Expand Down
8 changes: 1 addition & 7 deletions editor/assets/stylesheets/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,31 +121,25 @@ $float-margin: calc( 50% - #{ $visual-editor-max-width-padding / 2 } );
}

@mixin button-style__hover {
color: $dark-gray-900; // previously $blue-medium-500
color: $dark-gray-900;
box-shadow: inset 0 0 0 1px $light-gray-500, inset 0 0 0 2px $white;
}

@mixin button-style__focus-active() {
outline: none;
color: $dark-gray-900;
//box-shadow: inset 0 0 0 1px $dark-gray-500, inset 0 0 0 2px $white;
//background: $light-gray-300;
box-shadow: inset 0 0 0 1px $dark-gray-300, inset 0 0 0 2px $white;
}

@mixin button-style__active() {
outline: none;
color: $dark-gray-900;
//box-shadow: inset 0 0 0 1px $dark-gray-500, inset 0 0 0 2px $white;
//background: $light-gray-300;
box-shadow: inset 0 0 0 1px $dark-gray-400, inset 0 0 0 2px $white, 0 1px 1px rgba( $dark-gray-900, .2 );
}

@mixin tab-style__focus-active() {
outline: none;
color: $dark-gray-900;
//box-shadow: 0 0 0 1px $dark-gray-500;
//background: $light-gray-300;
box-shadow: inset 0 0 0 1px $dark-gray-300;
}

Expand Down
27 changes: 25 additions & 2 deletions editor/components/block-mover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,34 @@
pointer-events: none;
}

&:first-child {
margin-bottom: 4px;
}

// unstyle inherited icon button styles
&:not(:disabled):hover,
&:not(:disabled):active,
&:not(:disabled):focus {
box-shadow: none;
color: inherit;
}

// apply styles to SVG directly
.dashicon {
display: block;
position: relative; // Fixing the Safari bug for `<button>`s overflow
border-radius: 50%;
}

&:first-child {
margin-bottom: 4px;
&:not(:disabled):hover .dashicon {
@include button-style__hover;
}

&:not(:disabled):active .dashicon {
@include button-style__active;
}

&:not(:disabled):focus .dashicon {
@include button-style__focus-active;
}
}

0 comments on commit adbdbb7

Please sign in to comment.