From 3f1d0ca4758714557cbc71c66e5f1c57b5516b03 Mon Sep 17 00:00:00 2001 From: wando Date: Mon, 28 Oct 2024 15:47:32 +0100 Subject: [PATCH 1/5] Fix tabs jumping around and having different styles --- .../zen-styles/zen-tabs/vertical-tabs.css | 228 +++++++++--------- 1 file changed, 115 insertions(+), 113 deletions(-) diff --git a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css index 3028da65c..d49d99a43 100644 --- a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css +++ b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css @@ -7,6 +7,10 @@ height: 100%; } + #TabsToolbar { + padding: var(--zen-toolbox-padding); + } + #TabsToolbar > * { justify-content: center; } @@ -16,7 +20,7 @@ } #browser { - --zen-toolbox-padding: 5px; + --zen-toolbox-padding: var(--zen-element-separation); } #navigator-toolbox { @@ -91,7 +95,6 @@ animation: zen-slide-in 0.2s ease-in-out; max-width: unset !important; - padding: 0 !important; position: relative; @@ -185,7 +188,6 @@ #navigator-toolbox[zen-expanded='true']:not([zen-user-hover='true']) ) { --zen-toolbox-min-width: fit-content; - padding: var(--zen-toolbox-padding); padding-left: 0; padding-top: 0; @@ -242,9 +244,6 @@ &:not([zen-right-side='true']):not([zen-user-hover='true']) { padding-right: 0; - & #titlebar { - padding-left: var(--zen-toolbox-padding); - } } & #TabsToolbar-customization-target { @@ -300,7 +299,6 @@ box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.15) !important; } } - margin-inline: var(--tab-block-margin); } &:not([pinned]):is(:hover, [visuallyselected]) .tab-close-button { @@ -313,19 +311,20 @@ .tab-sharing-icon-overlay, .tab-icon-overlay { &:not([pinned]) { - margin-inline-end: var(--toolbarbutton-inner-padding) !important; - margin-inline-start: calc(var(--toolbarbutton-inner-padding) / 4) !important; + margin-inline-end: var(--toolbarbutton-inner-padding); + /* for no reason this button shifts its position 1px to left. Fix it by applying margin */ + margin-inline-start: 1px; } } } } @media (-moz-bool-pref: 'zen.view.compact') and (-moz-bool-pref: 'zen.view.compact.hide-toolbar') and (not (-moz-bool-pref: 'zen.view.compact.hide-tabbar')) { - & { - margin-top: var(--zen-element-separation) !important; - } + & { + margin-top: var(--zen-element-separation) !important; } } + } /* Mark: toolbox as collapsed */ #navigator-toolbox:not( @@ -340,8 +339,7 @@ ) ) { /* Important: When changin this value, make sure expand on hover doesn't break! */ - --zen-toolbox-max-width: 49px; /* 1px more because the browser view has one pixel of padding to avoid the border being cut off */ - --zen-toolbox-padding: 8px; + --zen-toolbox-max-width: 50px; /* 1px more because the browser view has one pixel of padding to avoid the border being cut off */ max-width: var(--zen-toolbox-max-width) !important; min-width: var(--zen-toolbox-max-width) !important; @@ -367,8 +365,15 @@ & #tabbrowser-arrowscrollbox-periphery { & > toolbarbutton { + padding: var(--toolbarbutton-inner-padding); + + & image { + height: 16px; + width: 16px; + padding: 0 !important; + } + margin: 0 auto !important; - padding: 0 !important; } &::before { @@ -394,7 +399,6 @@ } & #TabsToolbar-customization-target { - padding-bottom: var(--zen-toolbox-padding); &::after { bottom: -1px !important; @@ -402,7 +406,7 @@ } & #tabbrowser-tabs { - --tab-min-width: 36px !important; + --tab-min-width: 38px !important; & .tabbrowser-tab { margin: 0 auto; @@ -423,11 +427,6 @@ & .tab-label-container { display: none; } - - & .tab-icon-image, - & .tab-icon-pending { - margin-inline-end: 0 !important; - } } } @@ -446,12 +445,12 @@ #tabbrowser-tabs[secondarytext-unsupported], :root:not([uidensity='compact']) #tabbrowser-tabs:not([secondarytext-unsupported]) .tabbrowser-tab:hover ) - .tab-icon-stack[indicator-replaces-favicon] - > :not(&), + .tab-icon-stack[indicator-replaces-favicon] + > :not(&), :root:not([uidensity='compact']) - #tabbrowser-tabs:not([secondarytext-unsupported]) - .tabbrowser-tab:not(:hover) - &[indicator-replaces-favicon] { + #tabbrowser-tabs:not([secondarytext-unsupported]) + .tabbrowser-tab:not(:hover) + &[indicator-replaces-favicon] { opacity: 1 !important; } } @@ -502,118 +501,115 @@ /* Mark: Expand on hover */ @media (-moz-bool-pref: 'zen.view.sidebar-expanded.on-hover') and (not ((-moz-bool-pref: 'zen.view.compact') and (-moz-bool-pref: 'zen.view.compact.hide-tabbar'))) { - #zen-sidebar-splitter { - display: none !important; - } + #zen-sidebar-splitter { + display: none !important; + } - #navigator-toolbox { - z-index: 1; - } + #navigator-toolbox { + z-index: 1; + } - #TabsToolbar { - z-index: 1; - background-repeat: no-repeat !important; - background-position: center center !important; - background-size: cover !important; + #TabsToolbar { + z-index: 1; + background-repeat: no-repeat !important; + background-position: center center !important; + background-size: cover !important; - border-top: 1px solid transparent; + border-top: 1px solid transparent; - height: 100%; + height: 100%; - border-top-right-radius: var(--zen-border-radius); - width: var(--zen-toolbox-max-width); + border-top-right-radius: var(--zen-border-radius); + width: var(--zen-toolbox-max-width); - & .tabbrowser-tab { - transition: 0s !important; - } + & .tabbrowser-tab { + transition: 0s !important; } + } - #navigator-toolbox[zen-has-hover], - #navigator-toolbox:focus-within, - #navigator-toolbox[movingtab], - #navigator-toolbox[flash-popup], - #navigator-toolbox[has-popup-menu], - #navigator-toolbox:has(.tabbrowser-tab:active), - #navigator-toolbox:has(*[open='true']:not(tab):not(#zen-sidepanel-button)) { - --zen-toolbox-max-width: 49px; - max-width: var(--zen-toolbox-max-width) !important; - min-width: var(--zen-toolbox-max-width) !important; - padding: 0 !important; + #navigator-toolbox[zen-has-hover], + #navigator-toolbox:focus-within, + #navigator-toolbox[movingtab], + #navigator-toolbox[flash-popup], + #navigator-toolbox[has-popup-menu], + #navigator-toolbox:has(.tabbrowser-tab:active), + #navigator-toolbox:has(*[open='true']:not(tab):not(#zen-sidepanel-button)) { + --zen-toolbox-max-width: 50px; + max-width: var(--zen-toolbox-max-width) !important; + min-width: var(--zen-toolbox-max-width) !important; + padding: 0 !important; + + & #TabsToolbar { + z-index: 100 !important; + width: 250px !important; + background-color: var(--zen-dialog-background); + border-top-color: var(--zen-colors-border); + position: absolute; + transition: 0 !important; + /*animation: zen-vtabs-animation 0.3s ease-in-out;*/ + -moz-window-dragging: no-drag; + overflow: hidden; + transition: width 0.2s !important; + border-right: 1px solid var(--zen-colors-border); + + & .tab-throbber, + & .tab-icon-pending, + & .tab-sharing-icon-overlay, + & .tab-icon-overlay { + transition: 0.1s !important; + } + } - & #TabsToolbar { - z-index: 100 !important; - width: 250px !important; - - background: var(--zen-main-browser-background) !important; - background-attachment: fixed !important; - background-size: 2000px !important; /* Dont ask me why */ + /* Make pinned tabs stay in a single line */ + #vertical-pinned-tabs-container { + display: flex; + flex-direction: column; + gap: 0 !important; - box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2); + position: relative; - position: absolute; - padding: var(--zen-toolbox-padding); - padding-top: 0; - transition: 0 !important; - /*animation: zen-vtabs-animation 0.3s ease-in-out;*/ - -moz-window-dragging: no-drag; - overflow: hidden; - transition: width 0.2s !important; + & .tabbrowser-tab { + & .tab-label-container { + display: flex; + } & .tab-throbber, & .tab-icon-pending, & .tab-icon-image, & .tab-sharing-icon-overlay, & .tab-icon-overlay { - transition: 0.1s !important; + margin-inline-end: var(--toolbarbutton-inner-padding) !important; } - } - - /* Make pinned tabs stay in a single line */ - #vertical-pinned-tabs-container { - display: flex; - flex-direction: column; - gap: 0 !important; - position: relative; + &:not(:hover):not([selected]):not([multiselected]) .tab-background { + box-shadow: none; - & .tabbrowser-tab { - & .tab-label-container { - display: flex; - } - - & .tab-throbber, - & .tab-icon-pending, - & .tab-icon-image, - & .tab-sharing-icon-overlay, - & .tab-icon-overlay { - margin-inline-end: var(--toolbarbutton-inner-padding) !important; - } - - &:not(:hover):not([selected]):not([multiselected]) .tab-background { - box-shadow: none; - - background: transparent !important; - } + background: transparent !important; } } + } - &[zen-right-side='true'] #TabsToolbar { - right: 0; - border-top-left-radius: var(--zen-border-radius); - border-top-right-radius: 0; - } + &[zen-right-side='true'] #TabsToolbar { + animation: zen-sidebar-panel-animation-right 0.3s ease-in-out; - #navigator-toolbox:not(&) - #TabsToolbar - #tabbrowser-tabs[closebuttons='activetab'] - .tabbrowser-tab - .tab-content[class] - > .tab-close-button[class] { - display: none !important; - visibility: hidden !important; - } + right: 0; + border-right: 0; + border-left: 1px solid var(--zen-colors-border); + border-top-left-radius: var(--zen-border-radius); + border-top-right-radius: 0; + } + + #navigator-toolbox:not(&) + #TabsToolbar + #tabbrowser-tabs[closebuttons='activetab'] + .tabbrowser-tab + .tab-content[class] + > .tab-close-button[class] { + display: none !important; + visibility: hidden !important; } } +} /* Mark: Move sidebar to the right */ #browser:has(#navigator-toolbox[zen-right-side='true']) { @@ -699,6 +695,7 @@ } margin-top: 10px; + padding: 0 2px; position: relative; &::before { @@ -714,4 +711,9 @@ } } } + @media (-moz-bool-pref: 'zen.view.compact') { + #TabsToolbar { + margin-top: 0; + } + } } From 936d858d75be4b7cd7b6e84e6f013832edf50120 Mon Sep 17 00:00:00 2001 From: wando Date: Mon, 28 Oct 2024 16:15:11 +0100 Subject: [PATCH 2/5] sync with recent changes --- .../content/zen-styles/zen-tabs/vertical-tabs.css | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css index d49d99a43..8ba5ac862 100644 --- a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css +++ b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css @@ -542,15 +542,19 @@ & #TabsToolbar { z-index: 100 !important; width: 250px !important; - background-color: var(--zen-dialog-background); - border-top-color: var(--zen-colors-border); + + background: var(--zen-main-browser-background) !important; + background-attachment: fixed !important; + background-size: 2000px !important; /* Dont ask me why */ + + box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2); + position: absolute; transition: 0 !important; /*animation: zen-vtabs-animation 0.3s ease-in-out;*/ -moz-window-dragging: no-drag; overflow: hidden; transition: width 0.2s !important; - border-right: 1px solid var(--zen-colors-border); & .tab-throbber, & .tab-icon-pending, @@ -590,11 +594,7 @@ } &[zen-right-side='true'] #TabsToolbar { - animation: zen-sidebar-panel-animation-right 0.3s ease-in-out; - right: 0; - border-right: 0; - border-left: 1px solid var(--zen-colors-border); border-top-left-radius: var(--zen-border-radius); border-top-right-radius: 0; } From d112b6a908833a651c46454c874272ae8a8ba08d Mon Sep 17 00:00:00 2001 From: wando Date: Mon, 28 Oct 2024 16:20:37 +0100 Subject: [PATCH 3/5] Remove whitespace changes --- .../zen-styles/zen-tabs/vertical-tabs.css | 176 +++++++++--------- 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css index 8ba5ac862..0449cf73c 100644 --- a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css +++ b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css @@ -445,12 +445,12 @@ #tabbrowser-tabs[secondarytext-unsupported], :root:not([uidensity='compact']) #tabbrowser-tabs:not([secondarytext-unsupported]) .tabbrowser-tab:hover ) - .tab-icon-stack[indicator-replaces-favicon] - > :not(&), + .tab-icon-stack[indicator-replaces-favicon] + > :not(&), :root:not([uidensity='compact']) - #tabbrowser-tabs:not([secondarytext-unsupported]) - .tabbrowser-tab:not(:hover) - &[indicator-replaces-favicon] { + #tabbrowser-tabs:not([secondarytext-unsupported]) + .tabbrowser-tab:not(:hover) + &[indicator-replaces-favicon] { opacity: 1 !important; } } @@ -501,115 +501,115 @@ /* Mark: Expand on hover */ @media (-moz-bool-pref: 'zen.view.sidebar-expanded.on-hover') and (not ((-moz-bool-pref: 'zen.view.compact') and (-moz-bool-pref: 'zen.view.compact.hide-tabbar'))) { - #zen-sidebar-splitter { - display: none !important; - } - - #navigator-toolbox { - z-index: 1; - } - - #TabsToolbar { - z-index: 1; - background-repeat: no-repeat !important; - background-position: center center !important; - background-size: cover !important; - - border-top: 1px solid transparent; - - height: 100%; - - border-top-right-radius: var(--zen-border-radius); - width: var(--zen-toolbox-max-width); - - & .tabbrowser-tab { - transition: 0s !important; + #zen-sidebar-splitter { + display: none !important; } - } - #navigator-toolbox[zen-has-hover], - #navigator-toolbox:focus-within, - #navigator-toolbox[movingtab], - #navigator-toolbox[flash-popup], - #navigator-toolbox[has-popup-menu], - #navigator-toolbox:has(.tabbrowser-tab:active), - #navigator-toolbox:has(*[open='true']:not(tab):not(#zen-sidepanel-button)) { - --zen-toolbox-max-width: 50px; - max-width: var(--zen-toolbox-max-width) !important; - min-width: var(--zen-toolbox-max-width) !important; - padding: 0 !important; + #navigator-toolbox { + z-index: 1; + } - & #TabsToolbar { - z-index: 100 !important; - width: 250px !important; + #TabsToolbar { + z-index: 1; + background-repeat: no-repeat !important; + background-position: center center !important; + background-size: cover !important; - background: var(--zen-main-browser-background) !important; - background-attachment: fixed !important; - background-size: 2000px !important; /* Dont ask me why */ + border-top: 1px solid transparent; - box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2); + height: 100%; - position: absolute; - transition: 0 !important; - /*animation: zen-vtabs-animation 0.3s ease-in-out;*/ - -moz-window-dragging: no-drag; - overflow: hidden; - transition: width 0.2s !important; + border-top-right-radius: var(--zen-border-radius); + width: var(--zen-toolbox-max-width); - & .tab-throbber, - & .tab-icon-pending, - & .tab-sharing-icon-overlay, - & .tab-icon-overlay { - transition: 0.1s !important; + & .tabbrowser-tab { + transition: 0s !important; } } - /* Make pinned tabs stay in a single line */ - #vertical-pinned-tabs-container { - display: flex; - flex-direction: column; - gap: 0 !important; + #navigator-toolbox[zen-has-hover], + #navigator-toolbox:focus-within, + #navigator-toolbox[movingtab], + #navigator-toolbox[flash-popup], + #navigator-toolbox[has-popup-menu], + #navigator-toolbox:has(.tabbrowser-tab:active), + #navigator-toolbox:has(*[open='true']:not(tab):not(#zen-sidepanel-button)) { + --zen-toolbox-max-width: 50px; + max-width: var(--zen-toolbox-max-width) !important; + min-width: var(--zen-toolbox-max-width) !important; + padding: 0 !important; - position: relative; + & #TabsToolbar { + z-index: 100 !important; + width: 250px !important; - & .tabbrowser-tab { - & .tab-label-container { - display: flex; - } + background: var(--zen-main-browser-background) !important; + background-attachment: fixed !important; + background-size: 2000px !important; /* Dont ask me why */ + + box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2); + + position: absolute; + transition: 0 !important; + /*animation: zen-vtabs-animation 0.3s ease-in-out;*/ + -moz-window-dragging: no-drag; + overflow: hidden; + transition: width 0.2s !important; & .tab-throbber, & .tab-icon-pending, - & .tab-icon-image, & .tab-sharing-icon-overlay, & .tab-icon-overlay { - margin-inline-end: var(--toolbarbutton-inner-padding) !important; + transition: 0.1s !important; } + } + + /* Make pinned tabs stay in a single line */ + #vertical-pinned-tabs-container { + display: flex; + flex-direction: column; + gap: 0 !important; - &:not(:hover):not([selected]):not([multiselected]) .tab-background { - box-shadow: none; + position: relative; - background: transparent !important; + & .tabbrowser-tab { + & .tab-label-container { + display: flex; + } + + & .tab-throbber, + & .tab-icon-pending, + & .tab-icon-image, + & .tab-sharing-icon-overlay, + & .tab-icon-overlay { + margin-inline-end: var(--toolbarbutton-inner-padding) !important; + } + + &:not(:hover):not([selected]):not([multiselected]) .tab-background { + box-shadow: none; + + background: transparent !important; + } } } - } - &[zen-right-side='true'] #TabsToolbar { - right: 0; - border-top-left-radius: var(--zen-border-radius); - border-top-right-radius: 0; - } + &[zen-right-side='true'] #TabsToolbar { + right: 0; + border-top-left-radius: var(--zen-border-radius); + border-top-right-radius: 0; + } - #navigator-toolbox:not(&) - #TabsToolbar - #tabbrowser-tabs[closebuttons='activetab'] - .tabbrowser-tab - .tab-content[class] - > .tab-close-button[class] { - display: none !important; - visibility: hidden !important; + #navigator-toolbox:not(&) + #TabsToolbar + #tabbrowser-tabs[closebuttons='activetab'] + .tabbrowser-tab + .tab-content[class] + > .tab-close-button[class] { + display: none !important; + visibility: hidden !important; + } } } -} /* Mark: Move sidebar to the right */ #browser:has(#navigator-toolbox[zen-right-side='true']) { From e89e5ae9532c4b1daa10eb876683529d24572fe1 Mon Sep 17 00:00:00 2001 From: wando Date: Tue, 29 Oct 2024 13:09:19 +0100 Subject: [PATCH 4/5] Move logic related to compact mode to `zen-compact-mode.css` --- src/browser/base/content/zen-styles/zen-compact-mode.css | 5 +++++ .../base/content/zen-styles/zen-tabs/vertical-tabs.css | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/browser/base/content/zen-styles/zen-compact-mode.css b/src/browser/base/content/zen-styles/zen-compact-mode.css index 8dadbe4ef..82083cbed 100644 --- a/src/browser/base/content/zen-styles/zen-compact-mode.css +++ b/src/browser/base/content/zen-styles/zen-compact-mode.css @@ -2,6 +2,11 @@ @media (-moz-bool-pref: 'zen.view.compact') { :root:not([customizing]):not([inDOMFullscreen='true']) { + + #TabsToolbar { + padding-top: 0; + } + @media (-moz-bool-pref: 'zen.view.compact.hide-tabbar') { #zen-sidebar-web-panel-wrapper:has(#zen-sidebar-web-panel[pinned='true']) { margin-left: calc(var(--zen-sidebar-web-panel-spacing) * 2) !important; diff --git a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css index 0449cf73c..a04ca40ba 100644 --- a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css +++ b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css @@ -711,9 +711,4 @@ } } } - @media (-moz-bool-pref: 'zen.view.compact') { - #TabsToolbar { - margin-top: 0; - } - } } From 6870ae3f8abb5fad3670abd75a62af38f6e01c20 Mon Sep 17 00:00:00 2001 From: wando Date: Tue, 29 Oct 2024 13:09:41 +0100 Subject: [PATCH 5/5] Remove unneeded change for `toolbarbutton` styling --- .../base/content/zen-styles/zen-tabs/vertical-tabs.css | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css index a04ca40ba..2925c7dba 100644 --- a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css +++ b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css @@ -365,15 +365,8 @@ & #tabbrowser-arrowscrollbox-periphery { & > toolbarbutton { - padding: var(--toolbarbutton-inner-padding); - - & image { - height: 16px; - width: 16px; - padding: 0 !important; - } - margin: 0 auto !important; + padding: 0 !important; } &::before {