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

Try new button outline & focus styles #4512

Merged
merged 6 commits into from
Jan 18, 2018
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
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
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;
}

@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, 0 1px 1px rgba( $dark-gray-900, .2 );
}

@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
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;
}
}
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