Skip to content

Instantly share code, notes, and snippets.

@valrus
Last active February 12, 2020 21:46
Show Gist options
  • Save valrus/ccacaf0990d3b76d61adae65ed91d315 to your computer and use it in GitHub Desktop.
Save valrus/ccacaf0990d3b76d61adae65ed91d315 to your computer and use it in GitHub Desktop.
Favicons on the left with hover for close button in Firefox 57
/*
* Adapted from https://gist.github.com/bramus/724503
* with help from https://support.mozilla.org/en-US/questions/1157451
*
* Do not remove the @namespace line -- it's required for correct functioning
* set default namespace to XUL
*/
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* move favicon, throbber and text to the right so that the close button appears on the left */
.tabbrowser-tab .tab-throbber,
.tabbrowser-tab .tab-icon-image,
.tabbrowser-tab .tab-close-button {
-moz-box-ordinal-group: 0 !important;
}
/* hide close button initially */
.tabbrowser-tab .tab-close-button {
display: none !important;
}
/* show close + hide throbber & favicon on hover */
.tabbrowser-tab:hover .tab-close-button {
display: block !important;
margin-right: 3px !important;
margin-left: -1px !important;
}
.tabbrowser-tab:hover .tab-icon-image {
display: none !important;
}
.tabbrowser-tab:hover .tab-throbber {
display: none !important;
}
/* app tabs should not behave like regular tabs, so let them stay normal (viz. don't show close on hover) */
.tabbrowser-tab[pinned]:hover .tab-close-button {
display: none !important;
}
.tabbrowser-tab[pinned]:hover .tab-icon-image {
display: block !important;
}
/* disable top tabs if using a vertical tabs extension */
/* #TabsToolbar { visibility: collapse !important; } */
@valrus
Copy link
Author

valrus commented Sep 23, 2017

rev. 2 fixes tab labels shifting on hover in 57.0b2

@valrus
Copy link
Author

valrus commented Sep 29, 2017

rev. 3 adds a modification, disabled by default, to turn the top tab bar off in the case of a vertical tab extension

@ramkumarshankar
Copy link

Thanks for this! I wish this was the standard behaviour on MacOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment