nuclearcodecat / shimmer

pleasant firefox userchrome with sidebery support
GNU General Public License v3.0
99 stars 4 forks source link

titlebar not hidden when using css that hides it #14

Open moonfight1 opened 1 week ago

moonfight1 commented 1 week ago

i have a css snippet that hides the tabbar/titlebar when only one tab is opened

/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/hide_tabs_with_one_tab.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. 

This will NOT work correctly if you have hidden tabs such as with tab groups extensions
*/

/* This style causes CSD window controls to disappear on linux, but you can kind of work around that by using window_control_fallback_for_custom_windows_theme.css */

:root[sizemode="normal"] #nav-bar{ --uc-window-drag-space-width: 20px }

#titlebar{ -moz-appearance: none !important; }
#TabsToolbar{ min-height: 0px !important }

#tabbrowser-tabs,
#tabbrowser-arrowscrollbox{ min-height: 0 !important; }

.accessibility-indicator,
.private-browsing-indicator{ 
  height: unset !important;
}
.accessibility-indicator > hbox{ padding-block: 0 !important }

.tabbrowser-tab{
  height: calc(var(--tab-min-height) + 2 * var(--tab-block-margin,0px));
}

.tabbrowser-tab:only-of-type,
.tabbrowser-tab[first-visible-tab="true"][last-visible-tab="true"]{
  visibility: collapse !important;
  min-height: 0 !important;
  height: 0;
}

/* Fix window controls not being clickable */
:root[tabsintitlebar] #toolbar-menubar[autohide="true"][inactive]{
  transition: height 0ms steps(1) 80ms;
}
:where(#nav-bar){
  border-inline: var(--uc-window-drag-space-width,0) solid var(--toolbar-bgcolor);
}
@media (-moz-platform: linux){
  #TabsToolbar .titlebar-buttonbox{
    align-items: stretch !important;
  }
  #TabsToolbar > .titlebar-buttonbox-container > .titlebar-buttonbox > .titlebar-button{
    transform: scale(0.8);
    margin-inline: -3px !important;
  }
  #TabsToolbar .titlebar-button > .toolbarbutton-icon{ padding: 0 13px !important }
}

#tabbrowser-tabs:not([overflow]) ~ #alltabs-button{
  display: none;
}

#tabbrowser-arrowscrollbox-periphery,
#private-browsing-indicator-with-label,
#TabsToolbar > .titlebar-buttonbox-container{
  contain: strict;
  contain-intrinsic-height: 0px;
}
#tabbrowser-arrowscrollbox-periphery{
  contain-intrinsic-width: 36px;
  padding-inline-end: 3px;
}
#private-browsing-indicator-with-label{
  contain-intrinsic-width: 116px;
}
#TabsToolbar > .titlebar-buttonbox-container{
  contain-intrinsic-width: var(--uc-window-control-width,138px);
  margin-bottom: 0 !important;
}
@media  (-moz-platform: linux){
  #TabsToolbar > .titlebar-buttonbox-container{
    contain-intrinsic-width: var(--uc-window-control-width,105px);
  }
}
@media  (-moz-platform: macos){
  #TabsToolbar > .titlebar-buttonbox-container{
    contain-intrinsic-width: var(--uc-window-control-width,72px);
  }
}

when using this snippet with shimmers latest version (2.6), it hides the only tab open (when i only have one tab, which is what triggers the snippet) but doesnt hide the titlebar image

furthermore, it only happened when updating from 2.4 (i think) to 2.6

nuclearcodecat commented 1 week ago

could you please strip this code snippet down to a minimum viable example? i think this might be something with the fact that i've changed the entire structure of #navigator-toolbox, from being a flex to a grid element. you could try removing these styles to see if your snippet works. i guess this isn't really a shimmer issue but i'll try to have a look in free time

moonfight1 commented 1 week ago

well im gonna have to wait for the weekend to have enough time to do that :(

but as i said it only happened between 2.4 and 2.6 so maybe check what was changed there