Skip to content

Commit 25ec867

Browse files
Tabsbar: Fix close button auto hide
1 parent bb942a9 commit 25ec867

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

theme/parts/tabsbar.css

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,20 +167,15 @@ tab[selected]:-moz-window-inactive {
167167
margin-right: 2px;
168168
}
169169

170-
/* If tab close button is not present, don't force favicon to the center */
171-
#tabbrowser-tabs[closebuttons="activetab"] .tabbrowser-tab:not([selected="true"]) .tab-icon-stack {
172-
margin-left: 0 !important;
173-
}
174-
175170
/* Tab buttons */
176171
.tab-icon-overlay,
177172
.tab-close-button {
178-
-moz-appearance: none !important;
179173
border: 0px solid transparent;
180174
box-sizing: content-box; /* Avoid deformation on flexbox */
181175
border-radius: 99px !important;
182176
padding: 4px !important;
183177
background-size: 24px;
178+
transition: all 0.2s ease-out !important;
184179
}
185180
:root:not(:-moz-window-inactive) .tab-icon-overlay:hover,
186181
:root:not(:-moz-window-inactive) .tab-close-button:hover {
@@ -203,6 +198,7 @@ tab[selected]:-moz-window-inactive {
203198
height: 16px !important;
204199
opacity: 1 !important;
205200
width: 16px !important;
201+
z-index: 100 !important;
206202
}
207203
:root:-moz-window-inactive .tab-close-button:not(#hack) {
208204
opacity: .18 !important;
@@ -220,13 +216,48 @@ tab[selected]:-moz-window-inactive {
220216
box-shadow: none !important;
221217
}
222218

223-
/* Autohide (Still Horrible) */
224-
219+
/* Autohide */
225220
.tabbrowser-tab:not([selected="true"]) .tab-close-button {
226-
visibility: hidden;
221+
visibility: hidden !important;
222+
opacity: 0 !important;
227223
}
228224
.tabbrowser-tab:hover .tab-close-button {
229-
visibility: visible;
225+
visibility: visible !important;
226+
opacity: 1 !important;
227+
}
228+
229+
/* Fix close button position */
230+
.tabbrowser-tab:not([pinned]) .tab-label-container {
231+
margin-right: -16px;
232+
max-width: 80% !important;
233+
}
234+
#tabbrowser-tabs[closebuttons="activetab"] .tabbrowser-tab:not([pinned]) .tab-close-button {
235+
display: block !important;
236+
}
237+
238+
/* Close button overlay */
239+
.tabbrowser-tab:not([pinned]) .tab-content::after {
240+
bottom: 1px;
241+
content: "";
242+
height: 100%;
243+
opacity: 0;
244+
position: absolute;
245+
right: 0;
246+
width: 55px;
247+
z-index: 99;
248+
transition: all 0.2s ease-out;
249+
}
250+
.tabbrowser-tab:not([pinned]):is([selected="true"], :hover) .tab-content::after {
251+
opacity: 1;
252+
}
253+
.tabbrowser-tab:not([pinned])[selected="true"] .tab-content::after {
254+
background: linear-gradient(to left, var(--gnome-tabbar-tab-active-background) 50%, transparent);
255+
}
256+
:root:not(:-moz-window-inactive) .tabbrowser-tab:not([pinned])[selected="true"]:hover .tab-content::after {
257+
background: linear-gradient(to left, var(--gnome-tabbar-tab-active-hover-background) 50%, transparent);
258+
}
259+
.tabbrowser-tab:not([pinned]):hover .tab-content::after {
260+
background: linear-gradient(to left, var(--gnome-tabbar-tab-hover-background) 50%, transparent);
230261
}
231262

232263
/* Tab close button etc. positioning */

0 commit comments

Comments
 (0)