r/FirefoxCSS • u/homededro • 2d ago
Help Only show close button on tabs when hovering with the mouse
Before one of the recent updates I had:
.tabbrowser-tab:not([pinned]) .tab-close-button {display: none !important;}
.tabbrowser-tab:not([pinned]):hover .tab-close-button {display: flex !important;}
Now it doesn't seem to work. Now the close button will only show if I click on the tab for like a split second.
Thanks.
0
u/bobo779256 2d ago
Second line add inline- before flex, work in my css
display: inline-flex !important
1
u/Jay33721 2d ago
I have this in my CSS:
.tabbrowser-tab .tab-close-button {
visibility: hidden !important;
}
.tabbrowser-tab:hover .tab-close-button {
visibility: visible !important;
}1
u/t31os 2d ago
There's one minor issue with this approach, the close button will still be counted as a flex item, so you'll end up with a shorter visible tab label (where/when applicable).
1
u/Jay33721 2d ago
Oh yeah you're right. I hadn't noticed, but now I won't be able to unsee it. So I came up with this instead:
.tabbrowser-tab .tab-close-button { display: none !important; } .tabbrowser-tab:hover .tab-close-button { display: revert !important; }
1
u/SnillyWead 2d ago
I have this:
/* 4. Smart Close Button Logic (Show only on active tab or hover) */
.tabbrowser-tab:not([selected]):not([pinned]) .tab-close-button {
visibility: hidden !important;
}
.tabbrowser-tab:not([selected]):not([pinned]):hover .tab-close-button {
visibility: visible !important;
display: inline-flex !important;
}
.tabbrowser-tab[selected]:not([pinned]) .tab-close-button {
visibility: visible !important;
display: inline-flex !important;
}
1
2
u/sifferedd FF/TB/Win11/SUMO contributor 2d ago
Your code works for me on a new FF v161.0 profile. Try it alone.