Created
November 6, 2022 11:32
-
-
Save LouisHrg/7fb3e4ee9aa6df42bd14a4628de2efa2 to your computer and use it in GitHub Desktop.
Minimal firefox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_bookmarks_and_main_toolbars.css made available under Mozilla Public License v. 2.0 | |
See the above repository for updates as well as full license text. */ | |
#navigator-toolbox{ | |
--uc-bm-padding: 4px; /* Vertical padding to be applied to bookmarks */ | |
--uc-bm-height: calc(20px + 2 * var(--uc-bm-padding)); /* Might need to adjust if the toolbar has other buttons */ | |
--uc-navbar-height: -40px; /* navbar is main toolbar. Use negative value */ | |
--uc-autohide-toolbar-delay: 600ms; /* The toolbar is hidden after 0.6s */ | |
} | |
:root[uidensity="compact"] #navigator-toolbox{ | |
--uc-bm-padding: 1px; | |
--uc-navbar-height: -34px; | |
} | |
:root[uidensity="touch"] #navigator-toolbox{ --uc-bm-padding: 6px } | |
:root[sessionrestored] #nav-bar, | |
:root[sessionrestored] #PersonalToolbar{ | |
background-image: linear-gradient(var(--toolbar-bgcolor),var(--toolbar-bgcolor)), var(--lwt-additional-images,var(--toolbar-bgimage)) !important; | |
background-position: top,var(--lwt-background-alignment); | |
background-position-y: calc(0px - var(--tab-min-height) - 2*var(--tab-block-margin,0px)); | |
background-repeat: repeat,var(--lwt-background-tiling); | |
transform: rotateX(90deg); | |
transform-origin: top; | |
transition: transform 135ms linear var(--uc-autohide-toolbar-delay) !important; | |
z-index: 2; | |
} | |
:root[sessionrestored] #PersonalToolbar{ | |
z-index: 1; | |
background-position-y: calc(0px - var(--tab-min-height) - 2*var(--tab-block-margin,0px) + var( --uc-navbar-height)); | |
} | |
:root[lwtheme-image] #nav-bar, | |
:root[lwtheme-image] #PersonalToolbar{ | |
background-image: linear-gradient(var(--toolbar-bgcolor),var(--toolbar-bgcolor)),var(--lwt-header-image), var(--lwt-additional-images,var(--toolbar-bgimage)) !important; | |
} | |
#nav-bar[customizing],#PersonalToolbar[customizing]{ transform: none !important } | |
#navigator-toolbox > #PersonalToolbar{ | |
transform-origin: 0px var(--uc-navbar-height); | |
position: relative; | |
} | |
:root[sessionrestored]:not([customizing]) #navigator-toolbox{ | |
margin-bottom: calc(0px - var(--uc-bm-height) + var(--uc-navbar-height)); | |
} | |
#PlacesToolbarItems > .bookmark-item { | |
min-height: calc(var(--uc-bm-height) - 4px); /* Bookmarks have 2px block margin */ | |
padding-block: 0px !important; | |
} | |
#OtherBookmarks, | |
#PlacesChevron, | |
#PersonalToolbar > #import-button{ | |
padding-block: var(--uc-bm-padding) !important; | |
} | |
/* Make sure the bookmarks toolbar is never collapsed even if it is disabled */ | |
:root[sizemode="fullscreen"] #PersonalToolbar, | |
#PersonalToolbar[collapsed="true"]{ | |
min-height: initial !important; | |
max-height: initial !important; | |
visibility: hidden !important | |
} | |
#PersonalToolbar[collapsed="true"] #PlacesToolbarItems > *, | |
:root[sizemode="fullscreen"] #PersonalToolbar #PlacesToolbarItems > *{ | |
visibility: hidden !important; | |
} | |
/* The invisible toolbox will overlap sidebar so we'll work around that here */ | |
#navigator-toolbox{ pointer-events: none; border-bottom: none !important; } | |
#PersonalToolbar{ border-bottom: 1px solid var(--chrome-content-separator-color) } | |
#navigator-toolbox > *{ pointer-events: auto } | |
#sidebar-box{ position: relative } | |
/* Selected tab needs higher z-index now to "hide" the broder below it */ | |
.tabbrowser-tab[selected]{ z-index: 3 !important; } | |
/* SELECT TOOLBAR BEHAVIOR */ | |
/* Comment out or delete one of these to disable that behavior */ | |
/* Show when urlbar is focused */ | |
#nav-bar:focus-within + #PersonalToolbar, | |
#navigator-toolbox > #nav-bar:focus-within{ | |
transition-delay: 100ms !important; | |
transform: rotateX(0); | |
} | |
/* Show when cursor is over the toolbar area */ | |
#navigator-toolbox:hover > .browser-toolbar{ | |
transition-delay: 100ms !important; | |
transform: rotateX(0); | |
} | |
/* This makes the tab notification box show immediately below tabs, otherwise it would break the layout */ | |
#navigator-toolbox > div{ display: contents } | |
:where(#titlebar,#tab-notification-deck,.global-notificationbox){ | |
-moz-box-ordinal-group: 0; | |
} | |
/* Show when cursor is over popups/context-menus - cannot control which ones */ | |
/* | |
#mainPopupSet:hover ~ box > toolbox > .browser-toolbar{ | |
transition-delay: 100ms !important; | |
transform: rotateX(0); | |
} | |
*/ | |
#navigator-toolbox-background { | |
margin-top: -3px; | |
} | |
#alltabs-button { | |
display: none; | |
} | |
/* | |
How To: | |
1. Find your firefox profile folder : https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data | |
2. create a "chrome" folder if it doesn't exist | |
3. Paste content of this gist in a "userChrome.css" file | |
4. Go to about:config and set toolkit.legacyUserProfileCustomizations.stylesheets to true | |
5. Restart Firefox | |
Don't hesitate to say if there are bugs, I only tested this for my workflow : I don't use tabs | |
at all but I want to see the bar if I open a tab by mistake (otherwise I sometimes lose a tab) | |
*/ | |
/* Copy the default settings for --tab-min-height as --hidetabs-tab-min-height */ | |
:root { | |
--hidetabs-tab-min-height: 33px; | |
} | |
:root[uidensity=compact] { | |
--hidetabs-tab-min-height: 29px; | |
} | |
:root[uidensity=touch] { | |
--hidetabs-tab-min-height: 41px; | |
} | |
/* Set --tab-min-height to 0px so tab bar can disappear */ | |
#tabbrowser-tabs { | |
--tab-min-height: 0px; | |
} | |
/* Restore minimum height when more than one tab */ | |
#tabbrowser-tabs tab { | |
min-height: var(--hidetabs-tab-min-height); | |
} | |
/* Collapse tab bar when there is only one tab (tab is both first & last) */ | |
#tabbrowser-tabs tab[first-visible-tab="true"][last-visible-tab="true"] { | |
visibility: collapse; | |
} | |
/* Hide the New Tab button when there is only one tab (first visible tab is | |
adjacent to new tab button) */ | |
#tabbrowser-tabs tab[first-visible-tab="true"] + #tabs-newtab-button { | |
visibility: collapse; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment