Skip to content

Instantly share code, notes, and snippets.

@Jakob-PB
Last active January 26, 2021 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Jakob-PB/56835ff2a8743f11b601852fd02f0fdf to your computer and use it in GitHub Desktop.
Save Jakob-PB/56835ff2a8743f11b601852fd02f0fdf to your computer and use it in GitHub Desktop.
My custom userChrome.css file I use for tweaking Firefox's behaviour
/*** BEGIN - Override URL bar enlargement ***/
/* Compute new position, width, and padding */
#urlbar[breakout][breakout-extend] {
top: 5px !important;
left: 0px !important;
width: 100% !important;
padding: 0px !important;
}
/* for alternate Density settings */
[uidensity="compact"] #urlbar[breakout][breakout-extend] {
top: 3px !important;
}
[uidensity="touch"] #urlbar[breakout][breakout-extend] {
top: 4px !important;
}
/* Prevent shift of URL bar contents */
#urlbar[breakout][breakout-extend] > #urlbar-input-container {
height: var(--urlbar-height) !important;
padding: 0 !important;
}
/* Do not animate */
#urlbar[breakout][breakout-extend] > #urlbar-background {
animation: none !important;;
}
/* Remove shadows */
#urlbar[breakout][breakout-extend] > #urlbar-background {
box-shadow: none !important;
}
/*** END - Override URL bar enlargement ***/
/*** BEGIN - Autohide bookmarks ***/
#PersonalToolbar{
--uc-bm-height: 20px; /* Might need to adjust if the toolbar has other buttons */
--uc-bm-padding: 6px; /* Vertical padding to be applied to bookmarks */
--uc-autohide-toolbar-delay: 100ms; /* The toolbar is hidden after 0.1s */
}
:root[uidensity="compact"] #PersonalToolbar{ --uc-bm-padding: 1px }
:root[uidensity="touch"] #PersonalToolbar{ --uc-bm-padding: 6px }
#PersonalToolbar:not([customizing]){
position: relative;
margin-bottom: calc(0px - var(--uc-bm-height) - 2 * var(--uc-bm-padding));
transform: rotateX(90deg);
transform-origin: top;
transition: transform 135ms linear var(--uc-autohide-toolbar-delay) !important;
z-index: 1;
}
#PlacesToolbarItems > .bookmark-item{ padding-block: var(--uc-bm-padding) !important; }
/* SELECT BOOKMARKS TOOLBAR BEHAVIOR */
/* Comment out or delete either one of these to disable that behavior */
/* Show when urlbar is focused */
#nav-bar:focus-within + #PersonalToolbar{
transition-delay: 100ms !important;
transform: rotateX(0);
}
/* Show when cursor is over the toolbar area */
/* #navigator-toolbox:hover > #PersonalToolbar{
transition-delay: 100ms !important;
transform: rotateX(0);
} */
/*** END - Autohide bookmarks ***/
@Jakob-PB
Copy link
Author

To enable this Firefox bookmarks bar auto-hiding customization follow these steps:

  1. You will need to follow this guide to create a userChrome.css file that you can paste the contents of this gist into.
  2. Then you will need uncheck "Top Sites" in the address bar suggestions settings.
    image
  3. Finally make sure your bookmarks bar is set to "Always Shown".
    image

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