From b6adcce94f85b6c1aec1df0b0bfd0daac1dfdd90 Mon Sep 17 00:00:00 2001 From: alstjr7375 Date: Mon, 8 Aug 2022 11:10:55 +0900 Subject: [PATCH] Fix: Centered - Replace centered options - `userChrome.tab.centered_content` -> `userChrome.centered.tab` - `userChrome.tab.centered_label` -> `userChrome.centered.tab.label` - `userChrome.bookmarkbar.centered` -> `userChrome.centered.bookmarkbar` --- css/leptonChrome.css | 108 +++++++++--------- .../_bookmarkbar.scss} | 0 src/centered/_index.scss | 7 ++ src/centered/_tab.scss | 10 ++ .../centered => centered/tab}/_content.scss | 0 .../centered => centered/tab}/_label.scss | 0 .../centered => centered/tab}/_layout.scss | 0 src/leptonChrome.scss | 6 +- src/others/_index.scss | 4 - src/tab/_centered.scss | 10 -- src/tab/_index.scss | 3 - user.js | 8 +- 12 files changed, 78 insertions(+), 78 deletions(-) rename src/{others/_centered_bookmarkbar.scss => centered/_bookmarkbar.scss} (100%) create mode 100644 src/centered/_index.scss create mode 100644 src/centered/_tab.scss rename src/{tab/centered => centered/tab}/_content.scss (100%) rename src/{tab/centered => centered/tab}/_label.scss (100%) rename src/{tab/centered => centered/tab}/_layout.scss (100%) delete mode 100644 src/others/_index.scss delete mode 100644 src/tab/_centered.scss diff --git a/css/leptonChrome.css b/css/leptonChrome.css index b6f6e53..1818446 100644 --- a/css/leptonChrome.css +++ b/css/leptonChrome.css @@ -6372,52 +6372,6 @@ display: none !important; } } -/*= Tab Centered - Make to Center ============================================*/ -@supports -moz-bool-pref("userChrome.tab.centered_content") or -moz-bool-pref("userChrome.tab.centered_label") { - .tabbrowser-tab[selected]:not(:hover) .tab-label-container:not([textoverflow]), - .tabbrowser-tab:not(:hover, [pinned]) .tab-label-container:not([textoverflow]) { - margin-inline-end: 5px; - } - - @supports -moz-bool-pref("userChrome.tab.close_button_at_hover") { - #tabbrowser-tabs[closebuttons="activetab"] - .tabbrowser-tab:not(:hover, [pinned]) - .tab-label-container:not([textoverflow]) { - margin-inline-end: 1px; - } - - #tabbrowser-tabs[closebuttons="activetab"] - .tabbrowser-tab:not([selected]):not(:hover, [pinned]) - .tab-label-container - label { - padding-inline-end: 18px; - } - } -} -@supports -moz-bool-pref("userChrome.tab.centered_content") { - .tab-icon-stack { - -moz-box-flex: 1; - justify-content: end; - } -} -@supports -moz-bool-pref("userChrome.tab.centered_label") { - /* Based on https://github.com/MrOtherGuy/firefox-csshacks/blob/master/chrome/centered_tab_label.css */ - .tab-label-container { - display: grid; - justify-content: safe center; - align-items: safe center; - } - - .tab-label, - .tab-secondary-label { - overflow: hidden; - } - - .tabbrowser-tab[selected]:not(:hover) .tab-label-container:not([textoverflow]), - .tabbrowser-tab:not(:hover, [pinned]) .tab-label-container:not([textoverflow]) { - margin-inline-end: 5px; - } -} /** Url View UI ***************************************************************/ /*= Url View - Move icon to left =============================================*/ @supports -moz-bool-pref("userChrome.urlView.move_icon_to_left") { @@ -6539,14 +6493,6 @@ } } } -/** Other UI ******************************************************************/ -/*= Bookmark Bar - Centered ==================================================*/ -@supports -moz-bool-pref("userChrome.bookmarkbar.centered") { - #PlacesToolbarItems { - display: flex !important; - justify-content: safe center !important; - } -} /** Fullscreen - Overlap toolbar **********************************************/ @supports -moz-bool-pref("userChrome.fullscreen.overlap") { @supports -moz-bool-pref("browser.fullscreen.autohide") { @@ -6577,6 +6523,60 @@ /* Makes the bookmarks toolbar visible if enabled */ } } +/** Centered ******************************************************************/ +/*= Centered - Tab ===========================================================*/ +@supports -moz-bool-pref("userChrome.centered.tab") { + .tabbrowser-tab[selected]:not(:hover) .tab-label-container:not([textoverflow]), + .tabbrowser-tab:not(:hover, [pinned]) .tab-label-container:not([textoverflow]) { + margin-inline-end: 5px; + } + + @supports -moz-bool-pref("userChrome.tab.close_button_at_hover") { + #tabbrowser-tabs[closebuttons="activetab"] + .tabbrowser-tab:not(:hover, [pinned]) + .tab-label-container:not([textoverflow]) { + margin-inline-end: 1px; + } + + #tabbrowser-tabs[closebuttons="activetab"] + .tabbrowser-tab:not([selected]):not(:hover, [pinned]) + .tab-label-container + label { + padding-inline-end: 18px; + } + } + @supports not -moz-bool-pref("userChrome.centered.tab.label") { + .tab-icon-stack { + -moz-box-flex: 1; + justify-content: end; + } + } + @supports -moz-bool-pref("userChrome.centered.tab.label") { + /* Based on https://github.com/MrOtherGuy/firefox-csshacks/blob/master/chrome/centered_tab_label.css */ + .tab-label-container { + display: grid; + justify-content: safe center; + align-items: safe center; + } + + .tab-label, + .tab-secondary-label { + overflow: hidden; + } + + .tabbrowser-tab[selected]:not(:hover) .tab-label-container:not([textoverflow]), + .tabbrowser-tab:not(:hover, [pinned]) .tab-label-container:not([textoverflow]) { + margin-inline-end: 5px; + } + } +} +/*= Centered - Bookmark Bar ==================================================*/ +@supports -moz-bool-pref("userChrome.centered.bookmarkbar") { + #PlacesToolbarItems { + display: flex !important; + justify-content: safe center !important; + } +} /** Auto Hide *****************************************************************/ @supports -moz-bool-pref("userChrome.autohide.back_button") { #back-button[disabled="true"] { diff --git a/src/others/_centered_bookmarkbar.scss b/src/centered/_bookmarkbar.scss similarity index 100% rename from src/others/_centered_bookmarkbar.scss rename to src/centered/_bookmarkbar.scss diff --git a/src/centered/_index.scss b/src/centered/_index.scss new file mode 100644 index 0000000..b1b324f --- /dev/null +++ b/src/centered/_index.scss @@ -0,0 +1,7 @@ +/*= Centered - Tab ===========================================================*/ +@import "tab"; + +/*= Centered - Bookmark Bar ==================================================*/ +@include Option("userChrome.centered.bookmarkbar") { + @import "bookmarkbar"; +} diff --git a/src/centered/_tab.scss b/src/centered/_tab.scss new file mode 100644 index 0000000..bfc038e --- /dev/null +++ b/src/centered/_tab.scss @@ -0,0 +1,10 @@ +@include Option("userChrome.centered.tab") { + @import "tab/layout"; + + @include NotOption("userChrome.centered.tab.label") { + @import "tab/content"; + } + @include Option("userChrome.centered.tab.label") { + @import "tab/label"; + } +} diff --git a/src/tab/centered/_content.scss b/src/centered/tab/_content.scss similarity index 100% rename from src/tab/centered/_content.scss rename to src/centered/tab/_content.scss diff --git a/src/tab/centered/_label.scss b/src/centered/tab/_label.scss similarity index 100% rename from src/tab/centered/_label.scss rename to src/centered/tab/_label.scss diff --git a/src/tab/centered/_layout.scss b/src/centered/tab/_layout.scss similarity index 100% rename from src/tab/centered/_layout.scss rename to src/centered/tab/_layout.scss diff --git a/src/leptonChrome.scss b/src/leptonChrome.scss index dc2ae08..66f55ae 100644 --- a/src/leptonChrome.scss +++ b/src/leptonChrome.scss @@ -75,12 +75,12 @@ /** Sidebar UI ****************************************************************/ @import "sidebar/index"; -/** Other UI ******************************************************************/ -@import "others/index"; - /** Fullscreen - Overlap toolbar **********************************************/ @import "fullscreen/index"; +/** Centered ******************************************************************/ +@import "centered/index"; + /** Auto Hide *****************************************************************/ @import "autohide/index"; diff --git a/src/others/_index.scss b/src/others/_index.scss deleted file mode 100644 index ca2d0e5..0000000 --- a/src/others/_index.scss +++ /dev/null @@ -1,4 +0,0 @@ -/*= Bookmark Bar - Centered ==================================================*/ -@include Option("userChrome.bookmarkbar.centered") { - @import "centered_bookmarkbar"; -} diff --git a/src/tab/_centered.scss b/src/tab/_centered.scss deleted file mode 100644 index dc90af5..0000000 --- a/src/tab/_centered.scss +++ /dev/null @@ -1,10 +0,0 @@ -@include Option("userChrome.tab.centered_content", "userChrome.tab.centered_label") { - @import "centered/layout"; -} - -@include Option("userChrome.tab.centered_content") { - @import "centered/content"; -} -@include Option("userChrome.tab.centered_label") { - @import "centered/label"; -} diff --git a/src/tab/_index.scss b/src/tab/_index.scss index f83326c..ec088a5 100644 --- a/src/tab/_index.scss +++ b/src/tab/_index.scss @@ -39,6 +39,3 @@ @include Option("userChrome.tab.crashed") { @import "crashed_tab"; } - -/*= Tab Centered - Make to Center ============================================*/ -@import "centered"; diff --git a/user.js b/user.js index 31c0823..d34419c 100644 --- a/user.js +++ b/user.js @@ -93,6 +93,10 @@ user_pref("userChrome.rounding.square_tab", false); // user_pref("userChrome.hidden.selected_tab", true); // user_pref("userChrome.hidden.disabled_menu", true); +// user_pref("userChrome.centered.tab", true); +// user_pref("userChrome.centered.tab.label", true); +// user_pref("userChrome.centered.bookmarkbar", true); + // user_pref("userChrome.rounding.square_button", true); // user_pref("userChrome.rounding.square_panel", true); // user_pref("userChrome.rounding.square_panelitem", true); @@ -130,10 +134,6 @@ user_pref("userChrome.rounding.square_tab", false); // user_pref("userChrome.tab.close_button_at_pinned.background", true); // user_pref("userChrome.tab.close_button_at_hover.always", true); // Need close_button_at_hover // user_pref("userChrome.tab.sound_show_label", true); // Need remove sound_hide_label -// user_pref("userChrome.tab.centered_content", true); -// user_pref("userChrome.tab.centered_label", true); - -// user_pref("userChrome.bookmarkbar.centered", true); // user_pref("userChrome.panel.remove_strip", true); // user_pref("userChrome.panel.full_width_separator", true);