Skip to content

Instantly share code, notes, and snippets.

@MrOtherGuy
Created April 16, 2024 17:31
Show Gist options
  • Save MrOtherGuy/e627ebfd3c3313848a1f882cc42477b3 to your computer and use it in GitHub Desktop.
Save MrOtherGuy/e627ebfd3c3313848a1f882cc42477b3 to your computer and use it in GitHub Desktop.
.tabbrowser-tab:not([pinned])[selected]{ pointer-events: none }
:root{
--uc-window-control-width: 138px;
--uc-buttons-width: 116px;
--uc-window-drag-space-width: 40px;
--uc-menubar-height: 0px;
}
@media (-moz-platform: windows),
(-moz-platform: linux){
:root:is([sizemode="maximized"],[sizemode="fullscreen"]){
--uc-window-drag-space-width: 0px;
}
#titlebar:has(> [autohide="false"]) + #nav-bar{
--uc-window-drag-space-width: 0px;
--uc-menubar-height: 28px;
}
}
/* Add back pointer-events to several elements so UI remains usable */
/* The selected tab can be clicked normally from the icon */
#TabsToolbar toolbarbutton,
#TabsToolbar toolbaritem,
.tabbrowser-tab,
.tab-close-button,
.tab-icon-stack{
pointer-events: auto
}
/* Invisible capture box behind tabs*/
:root:not([customizing]) #urlbar-input-container::before{
position: fixed;
display: block;
left: 0;
top: var(--uc-menubar-height);
width: var(--uc-buttons-width);
height: calc(var(--tab-min-height) + 2*var(--tab-block-margin));
content: "";
pointer-events: auto;
z-index: 0;
}
:root[tabsintitlebar]:not([customizing]) #urlbar-input-container::before{
left: var(--uc-window-drag-space-width);
width: calc(100vw - var(--uc-window-control-width) - var(--uc-buttons-width) - 2 * var(--uc-window-drag-space-width));
}
#urlbar-input-container:focus-within::before{ display: none !important; }
/* Make tabs appear over the invisible box */
:root:not([customizing]) #TabsToolbar-customization-target{
position: relative;
z-index: 1;
pointer-events: none
}
#titlebar{
opacity: 1 !important;
will-change: unset !important;
transition: none !important;
}
: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);
opacity: 0;
transition: opacity 135ms linear var(--uc-autohide-toolbar-delay), z-index 0s linear calc(135ms + var(--uc-autohide-toolbar-delay)) !important;
z-index: 0;
}
:root[sessionrestored] #PersonalToolbar{
background-position-y: calc(0px - var(--tab-min-height) - 2*var(--tab-block-margin,0px) + var( --uc-navbar-height));
}
#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-navbar-height: -34px;
}
:root[uidensity="touch"] #navigator-toolbox{ --uc-bm-padding: 6px }
:root[chromehidden~="directories"] #navigator-toolbox{
--uc-bm-height: 0px;
}
:root[chromehidden~="toolbar"] #navigator-toolbox{
--uc-navbar-height: 0px;
}
:root[sessionrestored]:not([customizing]) #navigator-toolbox{
margin-bottom: calc(-1px - var(--uc-bm-height) + var(--uc-navbar-height));
}
/* Show when urlbar is focused */
#nav-bar:focus-within + #PersonalToolbar{
transition-delay: 100ms, 100ms !important;
opacity: 1;
z-index: 1;
}
#navigator-toolbox > #nav-bar:focus-within{
transition-delay: 0ms !important;
opacity: 1;
z-index: 2;
}
/* Show when cursor is over main menu popup - this requires :has selector support */
#mainPopupSet:has(> #appMenu-popup:hover) ~ #navigator-toolbox > .browser-toolbar{
transition-delay: 33ms !important;
opacity: 1;
}
/* 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){
order: -1;
}
:root[BookmarksToolbarOverlapsBrowser] #navigator-toolbox{
margin-bottom: calc(-1px - var(--uc-bm-height) + var(--uc-navbar-height)) !important;
z-index: auto !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment