style(firefox): finalize autohide toolbox for web-app profile

Successfully autohides both Tabs and Nav-bar using MrOtherGuy's strategy with a fixed trigger zone.
This commit is contained in:
kenji
2026-01-05 15:03:00 -06:00
parent 109fdb4672
commit 73aab2452e
+83 -33
View File
@@ -70,54 +70,104 @@
}; };
userChrome = '' userChrome = ''
/* --- Floating Autohide Toolbox (Tabs + Address Bar) --- */ /* --- Autohide Entire Toolbox (Tabs + Address Bar) --- */
/* Adapted from MrOtherGuy's autohide_main_toolbar.css */
:root { :root{
--toolbox-transition-duration: 0.2s; /* Height of Tabs + Nav Bar approx 80px */
--toolbox-transition-timing-function: ease; --uc-navbar-transform: -85px;
--uc-autohide-toolbar-delay: 0.1s;
--uc-autohide-toolbar-duration: 200ms;
} }
:root[uidensity="compact"]{ --uc-navbar-transform: -70px }
#navigator-toolbox { #navigator-toolbox > div{ display: contents; }
position: fixed !important;
top: 0; /* Apply transform to TabsToolbar AND Nav-bar */
left: 0; :root[sessionrestored] :where(#nav-bar,#PersonalToolbar,#TabsToolbar,#tab-notification-deck,.global-notificationbox,#notifications-toolbar){
width: 100%; transform: translateY(var(--uc-navbar-transform))
z-index: 9999 !important;
transition: transform var(--toolbox-transition-duration) var(--toolbox-transition-timing-function) !important;
transform: translateY(-100%) !important;
opacity: 0 !important;
} }
/* Reveal on hover */ :root:is([customizing],[chromehidden*="toolbar"]) :where(#nav-bar,#PersonalToolbar,#TabsToolbar,#tab-notification-deck,.global-notificationbox,#notifications-toolbar){
#navigator-toolbox:hover, transform: none !important;
#navigator-toolbox:focus-within {
transform: translateY(0) !important;
opacity: 1 !important; opacity: 1 !important;
} }
/* Trigger zone at top of screen */ /* Hide styles for Nav-Bar AND TabsToolbar */
:where(#nav-bar,#TabsToolbar):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;
}
#navigator-toolbox,
#sidebar-box,
#sidebar-main,
#sidebar-splitter,
#tabbrowser-tabbox{
z-index: auto !important;
}
/* Show when toolbox is focused or hovered */
#navigator-toolbox:focus-within > .browser-toolbar,
.browser-titlebar:hover ~ :is(#nav-bar,#PersonalToolbar,#TabsToolbar),
#nav-bar:hover,
#TabsToolbar: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;
}
/* Ensure popups still work (URL bar) */
: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);
}
:where(:root[sessionrestored]) #urlbar-container > #urlbar[popover]:is([focused],[open]){
transition-duration: 100ms;
}
/* --- CRITICAL FIX: Trigger Zone --- */
/* Since we hide EVERYTHING, we need a hitbox at the top of the screen */
#navigator-toolbox::after { #navigator-toolbox::after {
content: ""; content: "";
position: absolute; position: fixed;
top: 100%; /* Below the hidden toolbox */ top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 5px; /* Size of the trigger area */ height: 20px; /* Generous hit target */
z-index: 10000 !important; z-index: 10000;
pointer-events: auto;
}
/* When hitbox is hovered, reveal bars */
#navigator-toolbox:hover :where(#nav-bar,#PersonalToolbar,#TabsToolbar) {
transform: translateY(0) !important;
opacity: 1 !important;
transition-delay: 0s !important;
} }
/* Remove native titlebar so it doesn't mess up height */ /* Move up the content view to fill the gap */
#titlebar { :root[sessionrestored]:not([chromehidden~="toolbar"]) > body > #browser{
appearance: none !important; margin-top: var(--uc-navbar-transform);
margin-bottom: -10px !important; /* Pull things up if needed */
} }
/* Ensure content starts at top of screen */ /* Fix Titlebar and Bookmarks */
#browser, #appcontent, tabbrowser, #tab-notification-deck { #titlebar { appearance: none !important; }
margin-top: 0 !important;
}
/* Hide Bookmarks Toolbar permanently */
#PersonalToolbar { visibility: collapse !important; } #PersonalToolbar { visibility: collapse !important; }
''; '';
} }