Skip to content

Commit e97b65f

Browse files
authored
Merge pull request #4512 from WordPress/try/new-focus-outlines
Try new button outline & focus styles
2 parents f9486f1 + 5d50586 commit e97b65f

File tree

6 files changed

+39
-11
lines changed

6 files changed

+39
-11
lines changed

components/icon-button/style.scss

+10
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,14 @@
2222
&:not( :disabled ):hover {
2323
@include button-style__hover;
2424
}
25+
26+
&:not( :disabled ):active {
27+
@include button-style__active;
28+
}
29+
30+
&[aria-disabled=true]:focus,
31+
&:disabled:focus {
32+
box-shadow: none;
33+
}
34+
2535
}

editor/assets/stylesheets/_mixins.scss

+11-6
Original file line numberDiff line numberDiff line change
@@ -121,27 +121,32 @@ $float-margin: calc( 50% - #{ $visual-editor-max-width-padding / 2 } );
121121
}
122122

123123
@mixin button-style__hover {
124-
color: $dark-gray-900; // previously $blue-medium-500
124+
color: $dark-gray-900;
125+
box-shadow: inset 0 0 0 1px $light-gray-500, inset 0 0 0 2px $white, 0 1px 1px rgba( $dark-gray-900, .2 );
126+
}
127+
128+
@mixin button-style__active() {
129+
outline: none;
130+
color: $dark-gray-900;
131+
box-shadow: inset 0 0 0 1px $light-gray-700, inset 0 0 0 2px $white;
125132
}
126133

127134
@mixin button-style__focus-active() {
128135
outline: none;
129-
box-shadow: inset 0 0 0 1px $dark-gray-500, inset 0 0 0 2px $white;
130136
color: $dark-gray-900;
131-
background: $light-gray-300;
137+
box-shadow: inset 0 0 0 1px $dark-gray-300, inset 0 0 0 2px $white;
132138
}
133139

134140
@mixin tab-style__focus-active() {
135141
outline: none;
136-
box-shadow: 0 0 0 1px $dark-gray-500;
137142
color: $dark-gray-900;
138-
background: $light-gray-300;
143+
box-shadow: inset 0 0 0 1px $dark-gray-300;
139144
}
140145

141146
@mixin input-style__focus-active() {
142147
outline: none;
143-
box-shadow: 0 0 0 1px $dark-gray-500;
144148
color: $dark-gray-900;
149+
box-shadow: 0 0 0 1px $dark-gray-300;
145150
}
146151

147152
/**

editor/assets/stylesheets/main.scss

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ body.gutenberg-editor-page {
3030

3131
svg {
3232
fill: currentColor;
33+
outline: none;
3334
}
3435

3536
ul#adminmenu a.wp-has-current-submenu:after,

editor/components/block-mover/style.scss

+12-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,19 @@
1616
pointer-events: none;
1717
}
1818

19-
.dashicon {
20-
display: block;
21-
}
22-
2319
&:first-child {
2420
margin-bottom: 4px;
2521
}
22+
23+
&:not(:disabled):hover {
24+
@include button-style__hover;
25+
}
26+
27+
&:not(:disabled):active {
28+
@include button-style__active;
29+
}
30+
31+
&:not(:disabled):focus {
32+
@include button-style__focus-active;
33+
}
2634
}

editor/components/block-settings-menu/style.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
.editor-block-settings-menu__toggle {
1919
border-radius: 50%;
2020
padding: 3px;
21-
transform: rotate( 90deg );
2221
width: auto;
22+
23+
.dashicon {
24+
transform: rotate( 90deg );
25+
}
2326
}
2427

2528
.editor-block-settings-menu__control {

editor/edit-post/header/style.scss

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
left: 1px;
5656
}
5757

58+
&.is-toggled:hover,
5859
&.is-toggled:focus {
5960
outline: none;
6061
box-shadow: 0 0 0 1px $dark-gray-500, inset 0 0 0 1px $white;

0 commit comments

Comments
 (0)