From 5be03317152e8db86dcc80d56b502925cb1c8930 Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Sun, 23 Oct 2022 17:36:54 +0300 Subject: [PATCH] Make hide_tabs_with_one_tab_w_window_controls work in Fx108 --- ...de_tabs_with_one_tab_w_window_controls.css | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/chrome/hide_tabs_with_one_tab_w_window_controls.css b/chrome/hide_tabs_with_one_tab_w_window_controls.css index 4bd2b2e..75f1564 100644 --- a/chrome/hide_tabs_with_one_tab_w_window_controls.css +++ b/chrome/hide_tabs_with_one_tab_w_window_controls.css @@ -1,9 +1,13 @@ /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/hide_tabs_with_one_tab_w_window_controls.css made available under Mozilla Public License v. 2.0 See the above repository for updates as well as full license text. */ -/* Makes tabs toolbar items zero-height initially and sets enlarge them to fill up space equal to tab-min-height set on tabs. Optionally use privatemode_indicator_as_menu_button.css to replace main menu icon with private browsing indicator while tabs are hidden. */ -/* Firefox 65+ only */ -/* !!USER!! - REMOVE ALL BUTTONS you can from the tabs toolbar and menubar */ +/* Makes tabs toolbar items zero-height initially and sets enlarge them to fill + * up space equal to tab-min-height set on tabs. + * Optionally use privatemode_indicator_as_menu_button.css to replace main menu + * icon with private browsing indicator while tabs are hidden. + * REMOVE ALL BUTTONS from tabs toolbar and menubar including newtab-button + * and firefox-view-button - this style does not work otherwise. +**/ /* IMPORTANT */ /* @@ -11,26 +15,36 @@ Get window_control_placeholder_support.css Window controls will be all wrong without it */ +:root{ + --uc-menubar-height: 28px; /* adjust as necessary */ +} #titlebar{ -moz-appearance: none !important; } /* We'll use window controls from menubar instead */ #TabsToolbar > .titlebar-buttonbox-container { display: none } +/* Hide overflow button unless tabs overflow - is necessary for collpasing tabs with one tab */ +#tabbrowser-tabs:not([overflow="true"]) ~ #alltabs-button{ display: none } #tabbrowser-tabs, #tabbrowser-arrowscrollbox{ min-height: 0 !important; } #TabsToolbar > .titlebar-spacer[type="post-tabs"]{ width: calc(var(--uc-window-control-width,0px) + var(--uc-window-drag-space-post,0px)) !important; + -moz-box-ordinal-group: 2; } #toolbar-menubar > spacer{ pointer-events: none } -:root:not([customizing]) #tabs-newtab-button, -:root:not([customizing]) #tabbrowser-tabs .tabs-newtab-button{ +:root:not([customizing]) #tabs-newtab-button{ -moz-appearance: none !important; height: 0px; padding-block: 0px !important; -moz-box-align: stretch; margin: 0 !important; } +/* Need to hide private-browsing indicators, but you can still use privatemode_indicator_as_menu_button.css */ +#private-browsing-indicator, +#private-browsing-indicator-with-label{ + display: none; +} #tabs-newtab-button{ transform: scale(0.8); border-radius: var(--tab-border-radius); } @@ -45,7 +59,6 @@ Window controls will be all wrong without it } .tabbrowser-tab[first-visible-tab="true"][last-visible-tab="true"]{ visibility: collapse; - /* These seem unnecessary, but they achieve compatibility with hide_tabs_with_one_tab.css */ min-height: 0 !important; height: 0; } @@ -65,7 +78,7 @@ Window controls will be all wrong without it :root:not([customizing]) #toolbar-menubar[inactive]{ height: initial !important; min-height: initial !important; - margin-bottom: -28px !important; + margin-bottom: calc(0px - var(--uc-menubar-height,28px)) !important; } :root:not([customizing]) #toolbar-menubar[autohide][inactive] > #menubar-items{ pointer-events: none; opacity: 0 }