Advertisement
Guest User

Firefox CSS

a guest
Nov 27th, 2024
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 7.61 KB | Software | 0 0
  1. /* Defaults for window controls on RIGHT side of the window */
  2. /* Modify these values to match your preferences */
  3. :root:is([tabsintitlebar], [sizemode="fullscreen"]) {
  4.     --uc-window-control-width: 138px; /* Space reserved for window controls (Win10) */
  5.     /* Extra space reserved on both sides of the nav-bar to be able to drag the window */
  6.     --uc-window-drag-space-pre: 30px; /* left side*/
  7.     --uc-window-drag-space-post: 30px; /* right side*/
  8. }
  9.  
  10. :root:is([tabsintitlebar][sizemode="maximized"], [sizemode="fullscreen"]) {
  11.     --uc-window-drag-space-pre: 0px; /* Remove pre space */
  12. }
  13.  
  14. @media (-moz-platform: windows-win7), (-moz-platform: windows-win8) {
  15.     :root:is([tabsintitlebar], [sizemode="fullscreen"]) {
  16.         --uc-window-control-width: 105px;
  17.     }
  18. }
  19.  
  20. @media (-moz-gtk-csd-available) {
  21.     :root:is([tabsintitlebar],[sizemode="fullscreen"]) {
  22.         --uc-window-control-width: 84px;
  23.     }
  24. }
  25.  
  26. @media (-moz-platform: macos) {
  27.     :root:is([tabsintitlebar]) {
  28.         --uc-window-control-width: 72px;
  29.     }
  30.  
  31.     :root:is([tabsintitlebar][sizemode="fullscreen"]) {
  32.         --uc-window-control-width: 0;
  33.     }
  34. }
  35.  
  36. .titlebar-buttonbox, #window-controls {
  37.     color: var(--toolbar-color)
  38. }
  39.  
  40. :root[sizemode="fullscreen"] .titlebar-buttonbox-container {
  41.     display: none
  42. }
  43.  
  44. :root[sizemode="fullscreen"] #navigator-toolbox {
  45.     position: relative;
  46. }
  47.  
  48. :root[sizemode="fullscreen"] #TabsToolbar > .titlebar-buttonbox-container:last-child,
  49. :root[sizemode="fullscreen"] #window-controls {
  50.     position: absolute;
  51.     display: flex;
  52.     top: 0;
  53.     right: 0;
  54.     height: 40px;
  55. }
  56.  
  57. :root[sizemode="fullscreen"] #TabsToolbar > .titlebar-buttonbox-container:last-child,
  58. :root[uidensity="compact"][sizemode="fullscreen"] #window-controls {
  59.     height: 32px
  60. }
  61.  
  62. #nav-bar {
  63.     border-inline: var(--uc-window-drag-space-pre,0px) solid transparent;
  64.     border-inline-style: solid !important;
  65.     border-right-width: calc(var(--uc-window-control-width,0px) + var(--uc-window-drag-space-post,0px));
  66.     background-clip: border-box !important;
  67. }
  68.  
  69. /* Rules for window controls on left layout */
  70. @media (-moz-bool-pref: "userchrome.force-window-controls-on-left.enabled"), (-moz-gtk-csd-reversed-placement), (-moz-platform: macos) {
  71.     :root[tabsintitlebar="true"] #nav-bar {
  72.         border-inline-width: calc(var(--uc-window-control-width,0px) + var(--uc-window-drag-space-post,0px)) var(--uc-window-drag-space-pre,0px)
  73.     }
  74.  
  75.     :root[sizemode="fullscreen"] #TabsToolbar > .titlebar-buttonbox-container:last-child,
  76.     :root[sizemode="fullscreen"] #window-controls {
  77.         right: unset
  78.     }
  79. }
  80.  
  81. @media (-moz-bool-pref: "userchrome.force-window-controls-on-left.enabled") {
  82.     .titlebar-buttonbox-container {
  83.         order: -1 !important;
  84.     }
  85.  
  86.     .titlebar-buttonbox {
  87.         flex-direction: row-reverse;
  88.     }
  89. }
  90.  
  91. /* This pref can be used to force window controls on left even if that is not normal behavior on your OS */
  92. @supports -moz-bool-pref("userchrome.force-window-controls-on-left.enabled") {    
  93.     :root[tabsintitlebar="true"] #nav-bar {  
  94.         border-inline-width: calc(var(--uc-window-control-width,0px) + var(--uc-window-drag-space-post,0px)) var(--uc-window-drag-space-pre,0px)  
  95.     }
  96.  
  97.     :root[sizemode="fullscreen"] #TabsToolbar > .titlebar-buttonbox-container:last-child,
  98.     :root[sizemode="fullscreen"] #window-controls {  
  99.         right: unset;
  100.     }
  101.  
  102.     .titlebar-buttonbox-container {  
  103.         order: -1 !important;
  104.     } */
  105.  
  106.     .titlebar-buttonbox {
  107.         flex-direction: row-reverse;  
  108.     }
  109. }
  110.  
  111.  
  112. /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/hide_tabs_toolbar.css made available under Mozilla Public License v. 2.0
  113. See the above repository for updates as well as full license text. */
  114.  
  115. /* Hides tabs toolbar */
  116. /* For OSX use hide_tabs_toolbar_osx.css instead */
  117.  
  118. /* Note, if you have either native titlebar or menubar enabled, then you don't really need this style.
  119.  * In those cases you can just use: #TabsToolbar{ visibility: collapse !important }
  120.  */
  121.  
  122. /* IMPORTANT */
  123. /*
  124. Get window_control_placeholder_support.css
  125. Window controls will be all wrong without it
  126. */
  127.  
  128. :root[tabsintitlebar] {
  129.     --uc-toolbar-height: 40px;
  130. }
  131.  
  132.     :root[tabsintitlebar][uidensity="compact"] {
  133.         --uc-toolbar-height: 32px
  134.     }
  135.  
  136. #titlebar {
  137.     will-change: unset !important;
  138.     transition: none !important;
  139.     opacity: 1 !important;
  140. }
  141.  
  142. #TabsToolbar {
  143.     visibility: collapse !important
  144. }
  145.  
  146. :root[sizemode="fullscreen"] #TabsToolbar > :is(#window-controls,.titlebar-buttonbox-container) {
  147.     visibility: visible !important;
  148.     z-index: 2;
  149. }
  150.  
  151. :root:not([inFullscreen]) #nav-bar {
  152.     margin-top: calc(0px - var(--uc-toolbar-height,0px));
  153. }
  154.  
  155. :root[tabsintitlebar] #toolbar-menubar[autohide="true"] {
  156.     min-height: unset !important;
  157.     height: var(--uc-toolbar-height,0px) !important;
  158.     position: relative;
  159. }
  160.  
  161. #toolbar-menubar[autohide="false"] {
  162.     margin-bottom: var(--uc-toolbar-height,0px)
  163. }
  164.  
  165. :root[tabsintitlebar] #toolbar-menubar[autohide="true"] #main-menubar {
  166.     flex-grow: 1;
  167.     align-items: stretch;
  168.     background-attachment: scroll, fixed, fixed;
  169.     background-position: 0 0, var(--lwt-background-alignment), right top;
  170.     background-repeat: repeat-x, var(--lwt-background-tiling), no-repeat;
  171.     background-size: auto 100%, var(--lwt-background-size, auto auto), auto auto;
  172.     padding-right: 20px;
  173. }
  174.  
  175. :root[tabsintitlebar] #toolbar-menubar[autohide="true"]:not([inactive]) #main-menubar {
  176.     background-color: var(--lwt-accent-color);
  177.     background-image: linear-gradient(var(--toolbar-bgcolor,--toolbar-non-lwt-bgcolor),var(--toolbar-bgcolor,--toolbar-non-lwt-bgcolor)), var(--lwt-additional-images,none), var(--lwt-header-image, none);
  178.     mask-image: linear-gradient(to left, transparent, black 20px);
  179. }
  180.  
  181. #toolbar-menubar:not([inactive]) {
  182.     z-index: 2
  183. }
  184.  
  185. #toolbar-menubar[autohide="true"][inactive] > #menubar-items {
  186.     opacity: 0;
  187.     pointer-events: none;
  188.     margin-left: var(--uc-window-drag-space-pre,0px)
  189. }
  190.  
  191. /* Hide splitter, when using Tree Style Tab. */
  192. #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] + #sidebar-splitter {
  193.     display: none !important;
  194. }
  195. /* Hide sidebar header, when using Tree Style Tab. */
  196. #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
  197.     visibility: collapse;
  198. }
  199.  
  200. /* Shrink sidebar until hovered, when using Tree Style Tab. */
  201. #sidebar-box:not([sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"]) {
  202.     min-width: var(--wide-tab-width) !important;
  203.     max-width: none !important;
  204. }
  205.  
  206. #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] {
  207.     overflow: hidden !important;
  208.     position: relative !important;
  209.     transition: all 200ms !important;
  210.     min-width: var(--thin-tab-width) !important;
  211.     max-width: var(--thin-tab-width) !important;
  212.     z-index: 1;
  213. }
  214.  
  215.     #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"]:hover,
  216.     #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar {
  217.         transition: all 200ms !important;
  218.         min-width: var(--wide-tab-width) !important;
  219.         max-width: var(--wide-tab-width) !important;
  220.         margin-right: calc((var(--wide-tab-width) - var(--thin-tab-width)) * -1) !important;
  221.         z-index: 1;
  222.     }
  223.  
  224. :root {
  225.     --thin-tab-width: 37px;
  226. }
  227.  
  228. :root {
  229.     --wide-tab-width: 200px;
  230. }
  231.  
  232. /*Bring minimize, maximize and close buttons to toolbar*/
  233. #titlebar-buttonbox-container {
  234.     position: absolute;
  235. }
  236.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement