Bug 1444793 - Make focus style of tool tab to be same as hover style. r?nchevobbe
This patch removed the border and outline from focus style of tool tab and make
its style to be same as hover styles.
MozReview-Commit-ID: KD97vYiyUX2
--- a/devtools/client/themes/common.css
+++ b/devtools/client/themes/common.css
@@ -224,16 +224,25 @@ textbox :-moz-focusring {
/* Form fields should already have box-shadow hightlight */
select:-moz-focusring,
input[type="radio"]:-moz-focusring,
input[type="checkbox"]:-moz-focusring,
checkbox:-moz-focusring {
outline: none;
}
+/* Tab and button of toolbox does not need to display outline */
+
+.devtools-button:-moz-focusring,
+.devtools-tab:-moz-focusring {
+ outline:none;
+ padding-inline-end: 0;
+ padding-inline-start: 0;
+}
+
/* Toolbar buttons */
.devtools-menulist,
.devtools-toolbarbutton,
.devtools-button {
-moz-appearance: none;
background: transparent;
border: 1px solid var(--toolbarbutton-border-color);
border-radius: 2px;
@@ -243,16 +252,21 @@ checkbox:-moz-focusring {
text-shadow: none;
padding: 1px;
margin: 1px;
/* Button text should not wrap on multiple lines */
white-space: nowrap;
}
+/* Remove system form border from devtools-button. */
+.devtools-button::-moz-focus-inner {
+ border: 0;
+}
+
.devtools-toolbarbutton:not([label]) > .toolbarbutton-icon,
.devtools-button:empty::before {
width: 16px;
height: 16px;
margin: 0 3px;
transition: opacity 0.05s ease-in-out;
color: var(--theme-toolbar-color);
@@ -318,16 +332,20 @@ checkbox:-moz-focusring {
padding: 0 5px;
}
.devtools-toolbarbutton:not([label]):hover,
.devtools-button:empty:not(:disabled):hover {
background: var(--toolbarbutton-background);
}
+.devtools-button:focus {
+ background-color: var(--theme-toolbar-hover);
+}
+
.devtools-button:not(:empty):not(:disabled):not(.checked):hover,
.devtools-toolbarbutton[label]:not(:-moz-any([checked=true],[disabled])):hover,
.devtools-button:empty:not(:disabled):-moz-any(:hover:active,.checked),
.devtools-toolbarbutton:not([label]):-moz-any([checked],[open],:hover:active) {
background: var(--toolbarbutton-hover-background);
border-color: var(--toolbarbutton-hover-border-color);
}
@@ -709,16 +727,22 @@ checkbox:-moz-focusring {
.devtools-tab.selected .devtools-tab-line,
.tabs-menu-item.is-active .devtools-tab-line {
background: var(--tab-line-selected-color);
opacity: 1;
transform: scaleX(1);
}
+.devtools-tab:not(.selected):focus .devtools-tab-line {
+ background: var(--tab-line-hover-color);
+ opacity: 1;
+ transform: scaleX(1);
+}
+
/* No result message styles */
.devtools-sidepanel-no-result {
font-style: italic;
text-align: center;
padding: 0.5em;
-moz-user-select: none;
font-size: 12px;
--- a/devtools/client/themes/toolbox.css
+++ b/devtools/client/themes/toolbox.css
@@ -94,20 +94,26 @@
.devtools-tab-icon-only {
min-width: 24px;
}
.devtools-tab {
color: var(--theme-toolbar-color);
}
-.devtools-tab:hover {
+.devtools-tab:hover,
+.devtools-tab:focus {
background-color: var(--theme-toolbar-hover);
}
+/* Remove system control border from devtools-tab. */
+.devtools-tab::-moz-focus-inner {
+ border: 0;
+}
+
.devtools-tab:hover:active {
background-color: var(--theme-toolbar-hover-active);
}
.devtools-tab.selected {
color: var(--theme-toolbar-selected-color);
}