Skip to content

Instantly share code, notes, and snippets.

@Microtribute
Last active November 10, 2021 23:22
Show Gist options
  • Save Microtribute/e94f097ee8f791d0ba3b117368958949 to your computer and use it in GitHub Desktop.
Save Microtribute/e94f097ee8f791d0ba3b117368958949 to your computer and use it in GitHub Desktop.
Remove the gap between the tab bar and the window edges and between pinned tabs and unpinned tabs in Firefox

Annoying Gap Removal in Firefox

Overview

Firefox by default gets shipped with redudant spaces (at least for me). This hack removes the gaps between:

  • the tab bar and the window edges
  • pinned tabs and unpinned tabs

How?

  • Set toolkit.legacyUserProfileCustomizations.stylesheets to true in about:config.
  • Create a folder named chrome inside the profile directory (find the Root Directory in about:profiles).
  • Copy userChrome.css into the chrome folder you just created.
  • Restart Firefox.

Result

References

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* Remove the gap between the window edges and the tab bar */
.titlebar-placeholder[type="pre-tabs"],
.titlebar-placeholder[type="post-tabs"],
.titlebar-spacer[type="pre-tabs"],
.titlebar-spacer[type="post-tabs"] {
display: none !important;
width: 0px !important;
max-width: 0px !important;
}
/* Remove the gap between pinned tabs and unpinned tabs */
#tabbrowser-tabs[haspinnedtabs]:not([positionpinnedtabs]) > #tabbrowser-arrowscrollbox > .tabbrowser-tab[first-visible-unpinned-tab] {
margin-inline-start: 0 !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment