2020-05-22 05:13:58 +00:00
/ * Source file https : / / github . com / MrOtherGuy / firefox-csshacks / tree / master / chrome / multi-row_tabs_below_content . css made available under Mozilla Public License v . 2 . 0
See the above repository for updates as well as full license text . * /
2022-05-06 07:16:49 +00:00
/ * Makes tabs to appear on multiple lines below the web content
* Tab reordering will not work and can ' t be made to work
*
* Make menubar enabled for getting window controls in correct place .
* Menubar options will be shown as overlay when mouse is at top-left corner
* To enable static menubar , create a new boolean pref
* userchrome . multirowtabs . static-menubar . enabled
*
* It ' s recommended to move tabs new-tab-button outside tabs toolbar
*
* Change the --multirow-n-rows to change maximum number of rows
* before the rows will start to scroll .
* Scrollbar can ' t be clicked but the rows can be scrolled with mouse .
* /
2020-05-10 14:52:54 +00:00
@ -moz-document url ( chrome : / / browser / content / browser . xhtml ) {
2021-06-04 21:17:16 +00:00
2020-08-08 13:24:59 +00:00
: root {
--multirow-toolbar-height : 40px ;
--multirow-top-padding : 0px ;
--multirow-n-rows : 3 ;
--multirow-tab-min-width : 100px ;
--multirow-tab-dynamic-width : 1 ; /* Change to 0 for fixed-width tabs using the above width. */
2022-05-06 07:16:49 +00:00
--uc-window-drag-space-width : 30px ;
--uc-window-control-width : 138px ;
2020-08-08 13:24:59 +00:00
}
2022-11-20 12:13:28 +00:00
: root [ inFullscreen ] {
--uc-window-drag-space-width : 0px ;
}
@ media ( -moz-gtk-csd-available ) {
: root {
--uc-window-control-width : 94px ;
}
}
# main-window [ tabsintitlebar ] {
background-color : var ( --toolbar-bgcolor , accentcolor ) ! important ; ;
}
2022-05-06 07:16:49 +00:00
: root [ uidensity = "compact" ] { --multirow-toolbar-height : 34 px }
2020-08-08 13:24:59 +00:00
: root { border-top-width : 0 px !important }
2022-05-06 07:16:49 +00:00
# navigator-toolbox-background {
2023-03-11 10:26:07 +00:00
-moz-box-ordinal-group : 2 ; /* Fx <112 compatibility */
order : 2 ;
2022-03-27 12:31:59 +00:00
border-bottom : 0px ! important ;
}
2022-11-20 12:13:28 +00:00
# navigator-toolbox {
border-bottom : none ! important ;
}
2022-03-27 12:31:59 +00:00
/* Re-order window and tab notification boxes */
# navigator-toolbox > div { display : contents }
. global-notificationbox ,
2023-03-11 10:26:07 +00:00
# tab-notification-deck {
-moz-box-ordinal-group : 0 ; /* Fx <112 compatibility */
order : -1 ;
}
2020-08-08 13:24:59 +00:00
2022-05-06 07:16:49 +00:00
# titlebar { -moz- appearance : none !important ; } /* Try setting to "-moz-window-titlebar" if you face issues */
2020-08-08 13:24:59 +00:00
# nav-bar {
position : fixed ! important ;
2021-09-01 12:49:26 +00:00
/* For some reason -webkit-box behaves internally like -moz-box, but can be used with fixed position. display: flex would work too but it breaks extension menus. */
display : -webkit-box ;
-webkit-box-flex : 1 ;
2022-05-06 07:16:49 +00:00
margin-left : var ( --uc-window-drag-space-width ) ;
width : calc ( 100vw - var ( --uc-window-drag-space-width ) ) ;
2020-08-08 13:24:59 +00:00
top : var ( --multirow-top-padding ) ;
}
2021-11-06 20:23:29 +00:00
# nav-bar-customization-target { -webkit- box-flex : 1 }
2020-08-08 13:24:59 +00:00
: root [ inFullscreen ] # nav-bar ,
: root [ tabsintitlebar ] # nav-bar {
2022-05-06 07:16:49 +00:00
margin-right : var ( --uc-window-control-width ) ;
width : calc ( 100vw - var ( --uc-window-control-width ) - var ( --uc-window-drag-space-width ) ) ;
2020-08-08 13:24:59 +00:00
}
2022-11-20 12:13:28 +00:00
# TabsToolbar > . titlebar-buttonbox-container {
display : none ! important ;
}
2020-08-08 13:24:59 +00:00
/* Fix incorrect vertical alignment with megabar */
# urlbar [ breakout ] { --urlbar-toolbar-height : var ( - - multirow - toolbar - height ) !important ; }
/* Fix customization view */
# customization-panelWrapper > . panel-arrowbox > . panel-arrow { margin-inline-end : initial !important ; }
2022-11-20 12:13:28 +00:00
/* Fullscreen mode support */
2020-08-08 13:24:59 +00:00
# customization-container ,
: root : not ( [ inFullscreen ] ) # content-deck ,
2022-05-06 07:16:49 +00:00
: root : not ( [ inFullscreen ] ) # browser {
2022-11-20 12:13:28 +00:00
margin-top : calc ( var ( --multirow-toolbar-height ) + var ( --multirow-top-padding ) + var ( --multirow-menubar-height , 0px ) ) ;
2022-05-06 07:16:49 +00:00
}
2020-08-08 13:24:59 +00:00
: root [ inFullscreen ] # toolbar-menubar ,
2022-11-20 12:13:28 +00:00
: root [ inFullscreen ] # nav-bar {
top : calc ( 1px - ( var ( --multirow-toolbar-height ) + var ( --multirow-top-padding ) ) ) ;
}
2020-08-08 13:24:59 +00:00
: root [ inFullscreen ] # navigator-toolbox : hover > # nav-bar ,
2022-11-20 12:13:28 +00:00
: root [ inFullscreen ] # navigator-toolbox : hover > # titlebar > # toolbar-menubar {
top : 0px ;
}
# navigator-toolbox [ inFullscreen ] {
margin-top : 0 ! important ;
}
# navigator-toolbox [ inFullscreen ] [ style * = "margin-top" ] : not ( : hover ) {
max-height : 0px ;
}
# fullscr-toggler { bottom : 0 ; top : unset !important ; }
: root [ inFullscreen ] # navigator-toolbox : hover # toolbar-menubar {
pointer-events : none ! important ;
}
2020-08-08 13:24:59 +00:00
/* Restyle nav-bar and menubar */
# nav-bar-customization-target { flex-grow : 1 }
# nav-bar-overflow-button ,
# PanelUI-menu-button { height : var ( - - multirow - toolbar - height ) ; }
# toolbar-menubar {
height : var ( --multirow-toolbar-height ) ;
position : fixed ;
display : flex ;
visibility : visible ! important ;
top : var ( --multirow-top-padding ) ;
2022-11-20 12:13:28 +00:00
padding-top : 0 ! important ;
2020-08-08 13:24:59 +00:00
width : 100vw ;
color : var ( --lwt-text-color ) ;
background : linear-gradient ( to right , var ( --toolbar-bgcolor ) , var ( --toolbar-bgcolor ) 30px , transparent 30px ) no-repeat ;
}
# menubar-items + spacer { flex-grow : 1 }
# toolbar-menubar > # menubar-items {
height : 100 % ;
visibility : hidden ;
}
2022-05-06 07:16:49 +00:00
# main-menubar { height : var ( - - multirow - toolbar - height ) }
2020-08-08 13:24:59 +00:00
# toolbar-menubar : hover { z-index : 2 }
# toolbar-menubar : hover > # menubar-items {
visibility : visible ;
2022-11-19 08:22:05 +00:00
background-image : linear-gradient ( to left , transparent , var ( --lwt-accent-color ) 35px ) ;
2020-08-08 13:24:59 +00:00
}
2022-11-20 12:13:28 +00:00
# toolbar-menubar : not ( : hover , [ customizing ] ) * { -moz- window-dragging : drag !important ; }
2022-05-06 07:16:49 +00:00
# toolbar-menubar > . titlebar-buttonbox-container {
background : var ( --toolbar-bgcolor ) ;
order : 1000 ;
}
# menubar-items + spacer { order : 1000 }
2022-11-20 12:13:28 +00:00
# toolbar-menubar > . titlebar-buttonbox-container > . titlebar-buttonbox {
height : 100 % ;
pointer-events : auto ! important ;
}
2020-08-08 13:24:59 +00:00
# main-menubar : last-child { padding-inline-end : 40 px }
# toolbar-menubar > toolbarspring {
background : url ( "chrome://global/skin/icons/settings.svg" ) no-repeat 10px ;
height : 100 % ;
display : block ;
fill : currentColor ;
-moz-context-properties : fill ;
min-width : 28px ! important ;
max-width : 28px ! important ;
}
2022-05-06 07:16:49 +00:00
: root [ tabsintitlebar ] # PanelUI-button { margin-right : var ( - - uc - window - drag - space - width ) ; }
2020-08-08 13:24:59 +00:00
# tabbrowser-tabs {
min-height : unset ! important ;
padding-inline-start : 0px ! important
}
2020-05-10 14:52:54 +00:00
# scrollbutton-up ~ spacer ,
# scrollbutton-up ,
# scrollbutton-down { display : var ( - - scrollbutton - display - model , initial ) }
scrollbox [ part ] [ orient = "horizontal" ] {
display : flex ;
flex-wrap : wrap ;
overflow-y : auto ;
2020-06-26 11:02:12 +00:00
max-height : var ( --uc-scrollbox-max-height , 1px ) ;
2020-05-10 14:52:54 +00:00
scrollbar-color : currentColor transparent ;
scrollbar-width : thin ;
2023-04-09 06:00:12 +00:00
scrollbar-gutter : stable ;
2021-04-19 09:48:59 +00:00
scroll-snap-type : y mandatory ;
2020-05-10 14:52:54 +00:00
}
2020-06-26 11:02:12 +00:00
2020-08-08 13:36:09 +00:00
. scrollbox-clip [ orient = "horizontal" ] ,
2020-08-08 13:24:59 +00:00
# tabbrowser-arrowscrollbox {
overflow : -moz-hidden-unscrollable ;
2022-11-28 21:41:25 +00:00
display : inline ;
2020-08-08 13:24:59 +00:00
--scrollbutton-display-model : none ;
2021-06-04 21:17:16 +00:00
--uc-scrollbox-max-height : calc ( ( var ( --tab-min-height ) + 2 * var ( --tab-block-margin , 0px ) ) * var ( --multirow-n-rows ) ) ;
2020-08-08 13:24:59 +00:00
}
2020-08-08 13:36:09 +00:00
: root [ inFullscreen ] . scrollbox-clip [ orient = "horizontal" ] : not ( : hover ) ,
2020-08-08 13:24:59 +00:00
: root [ inFullscreen ] # tabbrowser-arrowscrollbox : not ( : hover ) { --uc-scrollbox-max-height : 1 px ; min-height : 1 px !important ; }
2021-04-19 09:48:59 +00:00
. tabbrowser-tab {
2021-06-04 21:17:16 +00:00
height : calc ( ( var ( --tab-min-height ) + 2 * var ( --tab-block-margin , 0px ) ) ) ! important ;
2021-04-19 09:48:59 +00:00
scroll-snap-align : start ;
}
2020-08-08 13:24:59 +00:00
. tabbrowser-tab [ pinned ] {
position : static ! important ;
margin-inline-start : 0px ! important ;
}
. tabbrowser-tab [ fadein ] : not ( [ pinned ] ) {
min-width : var ( --multirow-tab-min-width ) ! important ;
flex-grow : var ( --multirow-tab-dynamic-width ) ;
/ *
Uncomment to enable full-width tabs , also makes tab dragging a tiny bit more sensible
Don 't set to none or you' ll see errors in console when closing tabs
* /
/*max-width: 100vw !important;*/
}
. tabbrowser-tab > stack { width : 100 % ; height : 100 % ; }
/* This should fix potential flash that could occur when bottom border is hovered to show tabs in fullscreen mode */
2022-11-19 08:22:05 +00:00
# tabbrowser-tabpanels { background-color : var ( - - lwt - accent - color ) !important ; }
2020-08-08 13:24:59 +00:00
2021-11-01 16:39:58 +00:00
/* remove bottom margin so it doesn't throw off row height computation */
# tabs-newtab-button { margin-bottom : 0 !important ; }
2022-11-20 12:13:28 +00:00
2020-08-08 13:24:59 +00:00
/* Hide some things that are unnecessary in multi-row below content mode */
# alltabs-button ,
: root : not ( [ customizing ] ) # TabsToolbar # new-tab-button ,
# tabbrowser-arrowscrollbox > spacer ,
. tabbrowser-tab :: after { display : none !important } /* Also disables tab separators since they mysteriously break tab-row scrolling */
2022-05-06 07:16:49 +00:00
@ supports -moz-bool-pref ( "userchrome.multirowtabs.static-menubar.enabled" ) {
: root {
--multirow-menubar-height : 28px ;
--uc-window-drag-space-width : 0px ;
--uc-window-control-width : 0px ;
}
# main-menubar ,
# toolbar-menubar { height : var ( - - multirow - menubar - height ) ; background-image : none ; }
# toolbar-menubar > # menubar-items { visibility : visible ; background-image : none !important ; }
. titlebar-buttonbox-container { background : none !important }
: root : not ( [ inFullscreen ] ) # nav-bar {
top : calc ( var ( --multirow-menubar-height ) + var ( --multirow-top-padding ) ) ;
}
}
2022-11-20 12:13:28 +00:00
}