Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_main_toolbar.css made available under Mozilla Public License v. 2.0
- See the above repository for updates as well as full license text. */
- /* This style hides the main toolbar and shows it when the cursor is over the tabs toolbar as well as whenever the focus is inside nav-bar, such as when urlbar is focused. */
- :root{
- --uc-navbar-transform: -40px;
- --uc-autohide-toolbar-delay: 1.8s;
- --uc-autohide-toolbar-duration: 400ms;
- }
- :root[uidensity="compact"]{ --uc-navbar-transform: -34px }
- #navigator-toolbox > div{ display: contents; }
- :root[sessionrestored] :where(#nav-bar,#PersonalToolbar,#tab-notification-deck,.global-notificationbox){
- transform: translateY(var(--uc-navbar-transform))
- }
- :root:is([customizing],[chromehidden*="toolbar"]) :where(#nav-bar,#PersonalToolbar,#tab-notification-deck,.global-notificationbox){
- transform: none !important;
- opacity: 1 !important;
- }
- #nav-bar:not([customizing]){
- opacity: 0;
- transition: transform var(--uc-autohide-toolbar-duration) ease var(--uc-autohide-toolbar-delay), opacity var(--uc-autohide-toolbar-duration) ease var(--uc-autohide-toolbar-delay) !important;
- position: relative;
- z-index: 2;
- }
- #titlebar{ position: relative; z-index: 3 }
- #navigator-toolbox,
- #sidebar-box,
- #sidebar-main,
- #sidebar-splitter,
- #tabbrowser-tabbox{
- z-index: auto !important;
- }
- /* Show when toolbox is focused, like when urlbar has received focus */
- #navigator-toolbox:focus-within > .browser-toolbar{
- transform: translateY(0);
- opacity: 1;
- transition-duration: var(--uc-autohide-toolbar-duration), var(--uc-autohide-toolbar-duration) !important;
- transition-delay: 0s !important;
- }
- /* Show when toolbox is hovered */
- #titlebar:hover ~ .browser-toolbar,
- .browser-titlebar:hover ~ :is(#nav-bar,#PersonalToolbar),
- #nav-bar:hover,
- #nav-bar:hover + #PersonalToolbar{
- transform: translateY(0);
- opacity: 1;
- transition-duration: var(--uc-autohide-toolbar-duration), var(--uc-autohide-toolbar-duration) !important;
- transition-delay: 0s !important;
- }
- :root[sessionrestored] #urlbar[popover]{
- opacity: 0;
- pointer-events: none;
- transition: transform var(--uc-autohide-toolbar-duration) ease var(--uc-autohide-toolbar-delay), opacity var(--uc-autohide-toolbar-duration) ease var(--uc-autohide-toolbar-delay);
- transform: translateY(var(--uc-navbar-transform));
- }
- #mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#selection-shortcut-action-panel,#chat-shortcuts-options-panel,#tab-preview-panel)) ~ toolbox #urlbar[popover],
- .browser-titlebar:is(:hover,:focus-within) ~ #nav-bar #urlbar[popover],
- #nav-bar:is(:hover,:focus-within) #urlbar[popover],
- #urlbar-container > #urlbar[popover]:is([focused],[open]){
- opacity: 1;
- pointer-events: auto;
- transition-delay: 0ms;
- transform: translateY(0);
- }
- #urlbar-container > #urlbar[popover]:is([focused],[open]){
- transition-duration: 100ms; /* Faster when focused */
- }
- /* This ruleset is separate, because not having :has support breaks other selectors as well */
- #mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#selection-shortcut-action-panel,#chat-shortcuts-options-panel,#tab-preview-panel)) ~ #navigator-toolbox > .browser-toolbar{
- transition-delay: 33ms !important;
- transform: translateY(0);
- opacity: 1;
- }
- /* If tabs are in sidebar then nav-bar doesn't normally have its own background - so we nee to add it back */
- #nav-bar.browser-titlebar{
- background: inherit;
- }
- #toolbar-menubar:not([autohide="true"]) ~ #nav-bar.browser-titlebar{
- background-position-y: -28px; /* best guess, could vary */
- border-top: none !important;
- }
- /* Bookmarks toolbar needs so extra rules */
- #PersonalToolbar{ transition: transform var(--uc-autohide-toolbar-duration) ease var(--uc-autohide-toolbar-delay) !important; position: relative; z-index: 1 }
- /* Move up the content view */
- :root[sessionrestored]:not([chromehidden~="toolbar"]) > body > #browser{
- margin-top: var(--uc-navbar-transform);
- }
- @media -moz-pref("browser.fullscreen.autohide"),
- (-moz-bool-pref: "browser.fullscreen.autohide"){
- :root[sessionrestored][sizemode="fullscreen"] > body > #browser{
- margin-top: revert;
- }
- }
- /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/hide_tabs_toolbar_v2.css made available under Mozilla Public License v. 2.0
- See the above repository for updates as well as full license text. */
- /* This requires Firefox 133+ to work */
- @media (-moz-bool-pref: "sidebar.verticalTabs"){
- #sidebar-main{
- visibility: collapse;
- }
- }
- @media (-moz-bool-pref: "userchrome.force-window-controls-on-left.enabled"){
- #nav-bar > .titlebar-buttonbox-container{
- order: -1 !important;
- > .titlebar-buttonbox{
- flex-direction: row-reverse;
- }
- }
- }
- @media not (-moz-bool-pref: "sidebar.verticalTabs"){
- #TabsToolbar:not([customizing]){
- visibility: collapse;
- }
- :root[sizemode="fullscreen"] #nav-bar > .titlebar-buttonbox-container{
- display: flex !important;
- }
- :root:is([tabsintitlebar],[customtitlebar]) #toolbar-menubar:not([autohide="false"]) ~ #nav-bar{
- > .titlebar-buttonbox-container{
- display: flex !important;
- }
- :root[sizemode="normal"] & {
- > .titlebar-spacer{
- display: flex !important;
- }
- }
- :root[sizemode="maximized"] & {
- > .titlebar-spacer[type="post-tabs"]{
- display: flex !important;
- }
- @media (-moz-bool-pref: "userchrome.force-window-controls-on-left.enabled"),
- (-moz-gtk-csd-reversed-placement),
- (-moz-platform: macos){
- > .titlebar-spacer[type="post-tabs"]{
- display: none !important;
- }
- > .titlebar-spacer[type="pre-tabs"]{
- display: flex !important;
- }
- }
- }
- }
- }
- /* Hide splitter line */
- #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] + #sidebar-splitter {
- display: none !important;
- }
- /* Shrink sidebar until hovered */
- :root {
- --thin-tab-width: 31px;
- --wide-tab-width: 200px;
- }
- #sidebar-box:not([sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"]) {
- min-width: var(--wide-tab-width) !important;
- max-width: none !important;
- }
- #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] {
- overflow: hidden !important;
- position: relative !important;
- transition: all 300ms !important;
- /*transition: all 0ms 0s !important;*/
- min-width: var(--thin-tab-width) !important;
- max-width: var(--thin-tab-width) !important;
- z-index: 9999;
- }
- #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"]:hover,
- #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] #sidebar {
- /*transition-delay: 0s !important;*/
- transition: all 300ms !important;
- min-width: var(--wide-tab-width) !important;
- max-width: var(--wide-tab-width) !important;
- z-index: 9998;
- }
- /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_tabstoolbar_v2.css made available under Mozilla Public License v. 2.0
- See the above repository for updates as well as full license text. */
- /* Requires Firefox 133 */
- :root{
- --uc-tabs-hide-animation-duration: 48ms;
- --uc-tabs-hide-animation-delay: 200ms;
- }
- @media (-moz-bool-pref: "sidebar.verticalTabs"),
- -moz-pref("sidebar.verticalTabs"){
- #sidebar-main{
- overflow: visible !important;
- max-width: var(--tab-collapsed-width) !important;
- z-index: var(--browser-area-z-index-toolbox-while-animating);
- transition: z-index 0s linear var(--uc-tabs-hide-duration);
- background: inherit;
- }
- sidebar-main{
- --tab-pinned-horizontal-count: 5; /* This needs to match whatever is used in sidebar-main.css - currently 5 */
- background: inherit;
- overflow: hidden;
- min-width: var(--tab-collapsed-width);
- transition: min-width var(--uc-tabs-hide-animation-duration) ease-out var(--uc-tabs-hide-animation-delay);
- border-inline: 0.01px solid var(--chrome-content-separator-color);
- border-inline-width: 0 0.01px;
- &:is([sidebar-positionend],[positionend]){
- transition-property: min-width, transform;
- border-inline-width: 0.01px 0;
- }
- }
- sidebar-main:hover{
- min-width: calc(var(--tab-pinned-horizontal-count) * var(--tab-pinned-min-width-expanded) + 2 * var(--tab-pinned-container-margin-inline-expanded) + 1px);
- transition-delay: 0ms !important;
- &:is([sidebar-positionend],[positionend]){
- transform: translateX(calc(var(--tab-collapsed-width) - 100%));
- }
- }
- #sidebar-wrapper{
- background: inherit;
- }
- }
- @media not (-moz-bool-pref: "sidebar.verticalTabs"),
- not -moz-pref("sidebar.verticalTabs"){
- :root:not([customizing],[chromehidden~="menubar"]) #navigator-toolbox:hover,
- :root:not([customizing],[chromehidden~="menubar"]) #TabsToolbar{
- margin-bottom: calc(0px - 2 * var(--tab-block-margin) - var(--tab-min-height));
- }
- #navigator-toolbox{
- transition: margin-bottom var(--uc-tabs-hide-animation-duration) ease-out var(--uc-tabs-hide-animation-delay) !important;
- --browser-area-z-index-toolbox: 3;
- }
- #TabsToolbar:not([customizing]){
- visibility: hidden;
- transition: visibility 0ms linear var(--uc-tabs-hide-animation-delay),
- margin-bottom var(--uc-tabs-hide-animation-duration) ease-out var(--uc-tabs-hide-animation-delay) !important;
- }
- #navigator-toolbox:is(:hover,[movingtab]){
- transition-delay: 0s !important;
- > #TabsToolbar{
- visibility: visible;
- margin-bottom: 0px;
- transition-delay: 18ms, 0ms !important;
- }
- }
- @media (-moz-bool-pref: "userchrome.autohidetabs.show-while-inactive.enabled"),
- -moz-pref("userchrome.autohidetabs.show-while-inactive.enabled"){
- #navigator-toolbox:-moz-window-inactive{
- margin-bottom: calc(0px - 2 * var(--tab-block-margin) - var(--tab-min-height));
- > #TabsToolbar{
- visibility: visible;
- margin-bottom: 0px;
- }
- }
- }
- /* These rules make sure that height of tabs toolbar doesn't exceed tab-min-height */
- #tabbrowser-tabs:not([secondarytext-unsupported]) .tab-label-container{
- max-height: var(--tab-min-height);
- }
- .tab-label{ line-height: 20px !important; }
- :root[uidensity="compact"] .tab-label{ line-height: 18px !important; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement