Fix: Hidden - Remove padding at Menubar is shown #460

This commit is contained in:
alstjr7375 2022-09-02 09:30:03 +09:00
parent 5663d22e04
commit 8c1f8449e1
7 changed files with 63 additions and 2 deletions

34
__tests__/_has.test.scss Normal file
View file

@ -0,0 +1,34 @@
@use "true" as *;
@use "example" as *;
@use "../src/utils/has" as *;
@include test-module("`:has()` selector test [mix]") {
@include test("exist `:has()`") {
@include assert {
@include output {
@include Has {
@include example;
}
}
@include expect {
@supports selector(:has(a)) {
@include example;
}
}
}
}
@include test("don't exist `:has()`") {
@include assert {
@include output {
@include NotHas {
@include example;
}
}
@include expect {
@supports not selector(:has(a)) {
@include example;
}
}
}
}
}

View file

@ -4637,6 +4637,12 @@
} }
} }
} }
@supports selector(:has(a)) {
#navigator-toolbox:has(#toolbar-menubar[autohide="false"]) {
--uc-window-drag-space-pre: 0px;
--uc-window-control-space: 0px;
}
}
} }
@supports -moz-bool-pref("userChrome.tabbar.on_bottom") or -moz-bool-pref("userChrome.tabbar.one_liner") or -moz-bool-pref( @supports -moz-bool-pref("userChrome.tabbar.on_bottom") or -moz-bool-pref("userChrome.tabbar.one_liner") or -moz-bool-pref(
"userChrome.hidden.tabbar" "userChrome.hidden.tabbar"

View file

@ -5,7 +5,7 @@
will-change: margin-bottom, opacity; will-change: margin-bottom, opacity;
@include Option("userChrome.autohide.toolbar_overlap") { @include Option("userChrome.autohide.toolbar_overlap") {
@supports not selector(:has(a)) { @include NotHas {
&[collapsed="true"] { &[collapsed="true"] {
visibility: visible !important; visibility: visible !important;
max-height: unset !important; max-height: unset !important;

View file

@ -16,7 +16,7 @@
--uc-navbar-height: 0px; --uc-navbar-height: 0px;
} }
} }
@supports selector(:has(a)) { @include Has {
#navigator-toolbox:has(#PersonalToolbar[collapsed="true"]) { #navigator-toolbox:has(#PersonalToolbar[collapsed="true"]) {
--uc-bm-height: 0px; --uc-bm-height: 0px;
} }

View file

@ -6,6 +6,7 @@
@use "utils/native_menu" as *; @use "utils/native_menu" as *;
@use "utils/one_liner" as *; @use "utils/one_liner" as *;
@use "utils/window_control" as *; @use "utils/window_control" as *;
@use "utils/has" as *;
@use "utils/proton_elements" as Proton; @use "utils/proton_elements" as Proton;
@use "sass:selector"; @use "sass:selector";

View file

@ -101,3 +101,10 @@
} }
} }
} }
@include Has {
#navigator-toolbox:has(#toolbar-menubar[autohide="false"]) {
@include _remove_spacer_pre;
@include _remove_spacer_post;
}
}

13
src/utils/_has.scss Normal file
View file

@ -0,0 +1,13 @@
// Need `:has selector`
@mixin Has() {
@supports selector(:has(a)) {
@content;
}
}
@mixin NotHas() {
@supports not selector(:has(a)) {
@content;
}
}