Advertisement
Guest User

s4k - autohide_main_toolbar.css - FIXED

a guest
Dec 3rd, 2024
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.97 KB | Source Code | 0 0
  1. /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_main_toolbar.css made available under Mozilla Public License v. 2.0
  2. See the above repository for updates as well as full license text. */
  3.  
  4. /* 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. */
  5.  
  6. :root{
  7. --uc-navbar-transform: var(--amt-transform); /* userChrome.css */
  8. --uc-autohide-toolbar-delay: var(--amt-delay); /* userChrome.css */
  9. --uc-autohide-toolbar-duration: var(--amt-duration); /* userChrome.css */
  10. }
  11. :root[uidensity="compact"]{ --uc-navbar-transform: -34px }
  12.  
  13. #navigator-toolbox > div{ display: contents; }
  14. :root[sessionrestored] :where(#nav-bar,#PersonalToolbar,#tab-notification-deck,.global-notificationbox){
  15. transform: translateY(var(--uc-navbar-transform))
  16. }
  17. :root:is([customizing],[chromehidden*="toolbar"]) :where(#nav-bar,#PersonalToolbar,#tab-notification-deck,.global-notificationbox){
  18. transform: none !important;
  19. opacity: 1 !important;
  20. }
  21.  
  22. #nav-bar:not([customizing]){
  23. opacity: 0;
  24. 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;
  25. position: relative;
  26. z-index: 2;
  27. }
  28. #titlebar{ position: relative; z-index: 3 }
  29.  
  30. #navigator-toolbox,
  31. #sidebar-box,
  32. #sidebar-main,
  33. #sidebar-splitter,
  34. #tabbrowser-tabbox{
  35. z-index: auto !important;
  36. }
  37. /* Show when toolbox is focused, like when urlbar has received focus */
  38. #navigator-toolbox:focus-within > .browser-toolbar{
  39. transform: translateY(0);
  40. opacity: 1;
  41. transition-duration: var(--uc-autohide-toolbar-duration), var(--uc-autohide-toolbar-duration) !important;
  42. transition-delay: 0s !important;
  43. }
  44. /* Show when toolbox is hovered */
  45. #titlebar:hover ~ .browser-toolbar,
  46. .browser-titlebar:hover ~ :is(#nav-bar,#PersonalToolbar),
  47. #nav-bar:hover,
  48. #nav-bar:hover + #PersonalToolbar{
  49. transform: translateY(0);
  50. opacity: 1;
  51. transition-duration: var(--uc-autohide-toolbar-duration), var(--uc-autohide-toolbar-duration) !important;
  52. transition-delay: 0s !important;
  53. }
  54. :root[sessionrestored] #urlbar[popover]{
  55. opacity: 0;
  56. pointer-events: none;
  57. 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);
  58. transform: translateY(var(--uc-navbar-transform));
  59. }
  60. #mainPopupSet:has(> [role="group"][panelopen]) ~ toolbox #urlbar[popover],
  61. .browser-titlebar:is(:hover,:focus-within) ~ #nav-bar #urlbar[popover],
  62. #nav-bar:is(:hover,:focus-within) #urlbar[popover],
  63. #urlbar-container > #urlbar[popover]:is([focused],[open]){
  64. opacity: 1;
  65. pointer-events: auto;
  66. transition-delay: 0ms;
  67. transform: translateY(0);
  68. }
  69. #urlbar-container > #urlbar[popover]:is([focused],[open]){
  70. transition-duration: 100ms; /* Faster when focused */
  71. }
  72. /* This ruleset is separate, because not having :has support breaks other selectors as well */
  73. #mainPopupSet:has(> [role="group"][panelopen]) ~ #navigator-toolbox > .browser-toolbar{
  74. transition-delay: 33ms !important;
  75. transform: translateY(0);
  76. opacity: 1;
  77. }
  78. /* If tabs are in sidebar then nav-bar doesn't normally have its own background - so we nee to add it back */
  79. #nav-bar.browser-titlebar{
  80. background: inherit;
  81. }
  82. #toolbar-menubar:not([autohide="true"]) ~ #nav-bar.browser-titlebar{
  83. background-position-y: 0px; /* best guess, could vary */
  84. border-top: none !important;
  85. }
  86.  
  87. /* Bookmarks toolbar needs so extra rules */
  88. #PersonalToolbar{ transition: transform var(--uc-autohide-toolbar-duration) ease var(--uc-autohide-toolbar-delay) !important; position: relative; z-index: 1 }
  89.  
  90. /* Move up the content view */
  91. :root[sessionrestored]:not([inFullscreen],[chromehidden~="toolbar"]) > body > #browser{ margin-top: var(--uc-navbar-transform); }
  92.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement