Skip to content

Commit

Permalink
Merge pull request #4512 from WordPress/try/new-focus-outlines
Browse files Browse the repository at this point in the history
Try new button outline & focus styles
  • Loading branch information
jasmussen authored Jan 18, 2018
2 parents f9486f1 + 5d50586 commit e97b65f
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 11 deletions.
10 changes: 10 additions & 0 deletions components/icon-button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,14 @@
&:not( :disabled ):hover {
@include button-style__hover;
}

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

&[aria-disabled=true]:focus,
&:disabled:focus {
box-shadow: none;
}

}
17 changes: 11 additions & 6 deletions editor/assets/stylesheets/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,27 +121,32 @@ $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, 0 1px 1px rgba( $dark-gray-900, .2 );
}

@mixin button-style__active() {
outline: none;
color: $dark-gray-900;
box-shadow: inset 0 0 0 1px $light-gray-700, inset 0 0 0 2px $white;
}

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

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

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

/**
Expand Down
1 change: 1 addition & 0 deletions editor/assets/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ body.gutenberg-editor-page {

svg {
fill: currentColor;
outline: none;
}

ul#adminmenu a.wp-has-current-submenu:after,
Expand Down
16 changes: 12 additions & 4 deletions editor/components/block-mover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@
pointer-events: none;
}

.dashicon {
display: block;
}

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

&:not(:disabled):hover {
@include button-style__hover;
}

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

&:not(:disabled):focus {
@include button-style__focus-active;
}
}
5 changes: 4 additions & 1 deletion editor/components/block-settings-menu/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
.editor-block-settings-menu__toggle {
border-radius: 50%;
padding: 3px;
transform: rotate( 90deg );
width: auto;

.dashicon {
transform: rotate( 90deg );
}
}

.editor-block-settings-menu__control {
Expand Down
1 change: 1 addition & 0 deletions editor/edit-post/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
left: 1px;
}

&.is-toggled:hover,
&.is-toggled:focus {
outline: none;
box-shadow: 0 0 0 1px $dark-gray-500, inset 0 0 0 1px $white;
Expand Down

0 comments on commit e97b65f

Please sign in to comment.