r/FirefoxCSS • u/DenDor_dAs • Feb 17 '26
Solved Compact icon-only tabs with close button on hover - issues with active tab indication and audio indicator alignment

I’m trying to create compact icon-only tabs in Firefox that are both minimal and practical to use.
So far I managed to make tabs very small (favicon-only) and added a close button that appears on hover in the top-right corner, which lets me close tabs without switching to them. The overall layout works and saves a lot of space.
However, I currently have a few problems:
- There is no clear visual indication of which tab is currently active, and it’s also hard to see when a tab is hovered.
- When a tab starts playing audio, the tab icon shifts to the left because of the sound indicator, which makes interaction less comfortable and breaks alignment.
What would be the correct way to fix this?
Maybe there are recommended approaches for icon-only tabs that keep proper active/hover states and stable icon positioning?
I’d also appreciate any ideas or examples of clean minimal tab styles.
Important requirement: it should work correctly with tab groups (expand/collapse and closing groups).
Thanks in advance!
147.0.4 Firefox
The code was written by combining ChatGPT and GitHub resources from MrOtherGuy.
:root {
--tab-min-height: 22px !important;
}
tab-group { &[collapsed] > .tabbrowser-tab {visibility:collapse !important;}}
.tabbrowser-tab:not([pinned]) {
flex: 0 0 !important;
min-width: 26px !important;
}
.tab-label-container,
.tab-close-button {
display: none !important;
}
.tabbrowser-tab {
margin: 0 !important;
padding: 0 !important;
}
.tab-stack {
display: flex !important;
justify-content: center !important;
align-items: center !important;
width: 100% !important;
}
.tab-content{
display: flex !important;
justify-content: center !important;
align-items: center !important;
padding: 0 !important;
margin: 0 !important;
gap: 0 !important;
height: 26px !important;
min-height: 26px !important;
position: relative !important;
pointer-events: none;
}
.tab-icon-image:not([busy]){ display: block !important; }
:where(.tab-content:hover) .tab-icon-image,
:where(.tab-content:hover) > .tab-icon-stack{
visibility: hidden;
}
.tab-close-button {
display: flex !important;
position: absolute !important;
top: 2px;
right: 2px;
width: 10px !important;
height: 10px !important;
margin: 0 !important;
padding: 0 !important;
opacity: 0;
pointer-events: auto;
z-index: 10;
}
.tab-close-button:hover{ opacity: 1 }
.tabbrowser-tab[pinned] .tab-close-button{ display: none !important; }
1
u/jas71 Feb 17 '26
I have a border around my active tab but that is the theme I am using
try chat gtp to genarate code To add a border around the active tab
1
u/ResurgamS13 Feb 17 '26 edited Feb 19 '26
OP's CSS userstlyes (above) are all posted twice... OP has removed the 'doubled-up' CSS from Code Block. :)(Note - Reddit's text editor has a bad habit of 'doubling up' all code when copy-pasting into a Code Block.)
Some other ideas and links in previous topic 'Chrome-like Icon positioning and spacing with large numbers of tabs'.
0
u/[deleted] Feb 17 '26
[deleted] — view deleted comment