Advertisement
DenDor_dAs

Compact icon-only tabs in Firefox with a convenient close button

Jun 24th, 2025
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.23 KB | Software | 0 0
  1. /* Tabs as icons / Hover to close via X icon */
  2.  
  3. /* For better appearance, changed the value of browser.uidensity to 1 */
  4.  
  5. /* When hovering over the tab in the top-right corner, a small X will appear to close the tab */
  6.  
  7.  
  8. /* Normalize group behavior */
  9.  
  10. tab-group { &[collapsed] > .tabbrowser-tab {visibility:collapse !important;}}
  11.  
  12. /* Tabs as icons */
  13.  
  14. .tabbrowser-tab:not([pinned]) {
  15.   flex: 0 0 !important;
  16.   min-width: 36px !important;
  17. }
  18. .tab-label-container,
  19. .tab-close-button {
  20.   display: none !important;
  21. }
  22.  
  23. /* Compact close button in the top-right corner */
  24.  
  25. .tab-content{
  26.   pointer-events: none
  27. }
  28. .tab-icon-image:not([busy]){ display: block !important; }
  29. :where(.tab-content:hover) .tab-icon-image,
  30. :where(.tab-content:hover) > .tab-icon-stack{
  31.   visibility: hidden;
  32. }
  33.  
  34. /* === Compact close button in the top-right corner === */
  35. .tab-close-button {
  36.   display: flex !important;
  37.   position: absolute !important;
  38.   top: 2px;
  39.   right: 2px;
  40.   width: 12px !important;
  41.   height: 12px !important;
  42.   margin: 0 !important;
  43.   padding: 0 !important;
  44.   opacity: 0;
  45.   pointer-events: auto;
  46.   z-index: 10;
  47. }
  48.  
  49. .tab-close-button:hover{ opacity: 1 }
  50. .tabbrowser-tab[pinned] .tab-close-button{ display: none !important; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement