Skip to content

Commit 0eef12f

Browse files
committed
Merge branch 'refactoring' into dev
2 parents c236fe7 + 0d6ef76 commit 0eef12f

File tree

3 files changed

+105
-99
lines changed

3 files changed

+105
-99
lines changed

css/leptonChrome.css

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,18 @@
7777
/*= Remove Tab Border ========================================================*/
7878
@supports -moz-bool-pref("userChrome.tab.connect_to_window") {
7979
/* TARGET: original, photon */
80-
/* Light Theme */
81-
#TabsToolbar:not([brighttext])
80+
#TabsToolbar[brighttext]
8281
#tabbrowser-tabs:not([noshadowfortests])
8382
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
8483
> .tab-stack
85-
> .tab-background {
86-
border: unset !important;
87-
/* Nigtly 96: 1px solid var(--tab-line-color, rgba(128,128,142,0.9)); */
88-
}
89-
90-
/* Dark Theme */
91-
#TabsToolbar[brighttext]
84+
> .tab-background:-moz-lwtheme,
85+
#TabsToolbar:not([brighttext])
9286
#tabbrowser-tabs:not([noshadowfortests])
9387
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
9488
> .tab-stack
95-
> .tab-background:-moz-lwtheme {
89+
> .tab-background {
90+
/* Nigtly 96: 1px solid var(--tab-line-color, rgba(128,128,142,0.9)); */
9691
border: unset !important;
97-
/* Nigtly 96: 1px solid var(--tab-line-color, rgba(128,128,142,0.9)) */
9892
}
9993
}
10094
/*= Light Weight Theme =======================================================*/
@@ -105,7 +99,6 @@
10599
background-repeat: no-repeat !important;
106100
background-position: right top !important;
107101
}
108-
109102
@media (min-width: 2500px) {
110103
:root[lwtheme-image] {
111104
background-size: contain;
@@ -138,11 +131,9 @@
138131
:root[sizemode="normal"][tabsintitlebar] #navigator-toolbox {
139132
border-top: 0.5px solid #2f2f2f !important;
140133
}
141-
142134
:root[sizemode="normal"][tabsintitlebar]:-moz-window-inactive #navigator-toolbox {
143135
border-top-color: #393939 !important;
144136
}
145-
146137
@media (-moz-windows-accent-color-in-titlebar) {
147138
:root[sizemode="normal"][tabsintitlebar] #navigator-toolbox {
148139
border-top-color: -moz-accent-color !important;
@@ -160,18 +151,19 @@
160151
}
161152
}
162153
@media (-moz-os-version: windows-win7), (-moz-platform: windows-win7) {
163-
#TabsToolbar:-moz-lwtheme {
164-
color: var(--lwt-text-color) !important;
165-
}
166-
167-
/* Remove Aero */
168154
#TabsToolbar {
155+
/* Remove Aero */
169156
/* Original: radial-gradient(eclipse at bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.5) 80%, transparent) */
170157
background-image: unset !important;
171158
}
159+
#TabsToolbar:-moz-lwtheme {
160+
/* background textcolor */
161+
color: var(--lwt-text-color) !important;
162+
}
172163
}
173164
@media (-moz-os-version: windows-win8), (-moz-platform: windows-win8) {
174165
#navigator-toolbox:-moz-lwtheme {
166+
/* background textcolor */
175167
color: var(--lwt-text-color) !important;
176168
}
177169
}
@@ -214,7 +206,6 @@
214206
border: none !important;
215207
/* Remove border */
216208
}
217-
218209
#PlacesToolbar menu:not([disabled], :active)[_moz-menuactive="true"],
219210
#PlacesToolbar menuitem:not([disabled], :active)[_moz-menuactive="true"],
220211
#BMB_bookmarksPopup menu:not([disabled], :active)[_moz-menuactive="true"],

src/compatibility/_os.scss

Lines changed: 51 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
/*= Windows 10 - Top border of accent color at ESR #358 ======================*/
22
@include OS($win10) {
3-
:root[sizemode=normal][tabsintitlebar] #navigator-toolbox {
4-
border-top: .5px solid rgb(47, 47, 47) !important;
5-
}
6-
:root[sizemode=normal][tabsintitlebar]:-moz-window-inactive #navigator-toolbox {
7-
border-top-color: rgb(57, 57, 57) !important;
8-
}
9-
@media (-moz-windows-accent-color-in-titlebar) {
10-
:root[sizemode=normal][tabsintitlebar] #navigator-toolbox {
11-
border-top-color: -moz-accent-color !important;
3+
:root[sizemode=normal][tabsintitlebar] {
4+
#navigator-toolbox {
5+
border-top: .5px solid rgb(47, 47, 47) !important;
6+
}
7+
&:-moz-window-inactive #navigator-toolbox {
8+
border-top-color: rgb(57, 57, 57) !important;
9+
}
10+
11+
@media (-moz-windows-accent-color-in-titlebar) {
12+
#navigator-toolbox {
13+
border-top-color: -moz-accent-color !important;
14+
}
1215
}
1316
}
1417
}
@@ -20,20 +23,25 @@
2023
background-color: var(--lwt-accent-color) !important;
2124
}
2225
}
23-
@include OS($win7) {
24-
#TabsToolbar:-moz-lwtheme {
25-
color: var(--lwt-text-color) !important;
26-
}
2726

28-
/* Remove Aero */
27+
@mixin _os_winTabBarTextColor {
28+
/* background textcolor */
29+
color: var(--lwt-text-color) !important;
30+
}
31+
@include OS($win7) {
2932
#TabsToolbar {
33+
&:-moz-lwtheme {
34+
@include _os_winTabBarTextColor;
35+
}
36+
37+
/* Remove Aero */
3038
/* Original: radial-gradient(eclipse at bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.5) 80%, transparent) */
3139
background-image: unset !important;
3240
}
3341
}
3442
@include OS($win8) {
3543
#navigator-toolbox:-moz-lwtheme {
36-
color: var(--lwt-text-color) !important;
44+
@include _os_winTabBarTextColor;
3745
}
3846
}
3947

@@ -66,26 +74,27 @@
6674
#BMB_bookmarksPopup menu,
6775
#BMB_bookmarksPopup menuitem {
6876
border: none !important; /* Remove border */
69-
}
70-
#PlacesToolbar menu:not([disabled], :active)[_moz-menuactive="true"],
71-
#PlacesToolbar menuitem:not([disabled], :active)[_moz-menuactive="true"],
72-
#BMB_bookmarksPopup menu:not([disabled], :active)[_moz-menuactive="true"],
73-
#BMB_bookmarksPopup menuitem:not([disabled], :active)[_moz-menuactive="true"] {
74-
background-color: var(--button-hover-bgcolor) !important;
77+
78+
&:not([disabled], :active)[_moz-menuactive="true"] {
79+
background-color: var(--button-hover-bgcolor) !important;
80+
}
7581
}
7682
}
7783

78-
@include OS($win7) {
84+
@mixin _os_menuEmulate($bgRate, $bdRate) {
7985
menu[_moz-menuactive="true"],
8086
menuitem[_moz-menuactive="true"] {
81-
background-color: color-mix(in srgb, -moz-menuhover 5%, transparent) !important;
82-
border-color: color-mix(in srgb, -moz-menuhover 60%, transparent) !important;
87+
background-color: color-mix(in srgb, -moz-menuhover $bgRate, transparent) !important;
88+
border-color: color-mix(in srgb, -moz-menuhover $bdRate, transparent) !important;
8389
}
8490
menu[_moz-menuactive="true"][disabled="disabled"],
8591
menuitem[_moz-menuactive="true"][disabled="true"] {
86-
background-color: color-mix(in srgb, currentColor 5%, transparent) !important;
87-
border-color: color-mix(in srgb, currentColor 60%, transparent) !important;
92+
background-color: color-mix(in srgb, currentColor $bgRate, transparent) !important;
93+
border-color: color-mix(in srgb, currentColor $bdRate, transparent) !important;
8894
}
95+
}
96+
@include OS($win7) {
97+
@include _os_menuEmulate(5%, 60%);
8998

9099
/* Remove text shadow */
91100
:root:-moz-lwtheme #toolbar-menubar {
@@ -100,16 +109,7 @@
100109
}
101110
}
102111
@include OS($win8) {
103-
menu[_moz-menuactive="true"],
104-
menuitem[_moz-menuactive="true"] {
105-
background-color: color-mix(in srgb, -moz-menuhover 17%, transparent) !important;
106-
border-color: color-mix(in srgb, -moz-menuhover 80%, transparent) !important;
107-
}
108-
menu[_moz-menuactive="true"][disabled="disabled"],
109-
menuitem[_moz-menuactive="true"][disabled="true"] {
110-
background-color: color-mix(in srgb, currentColor 17%, transparent) !important;
111-
border-color: color-mix(in srgb, currentColor 80%, transparent) !important;
112-
}
112+
@include _os_menuEmulate(17%, 80%);
113113
}
114114

115115
@include OS($linux) {
@@ -140,6 +140,15 @@
140140
}
141141

142142
/*= Linux - Light System Default Theme's Selected Tab ========================*/
143+
$_os_linuxDefaultShadow: 0 0 4px rgba(128, 128, 142, 0.5);
144+
@mixin _os_linuxDefaultThemeSelectedTab {
145+
#tabbrowser-tabs:not([noshadowfortests])
146+
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
147+
> .tab-stack
148+
> .tab-background:not(:-moz-lwtheme) {
149+
@content;
150+
}
151+
}
143152
@include OS($linux) {
144153
@include Light {
145154
/* Because of
@@ -148,18 +157,13 @@
148157
box-shadow: 0 0 4px rgba(128,128,142,0.5);
149158
}
150159
*/
151-
#tabbrowser-tabs:not([noshadowfortests])
152-
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
153-
> .tab-stack
154-
> .tab-background:not(:-moz-lwtheme) {
155-
box-shadow: 0 0 4px rgba(128, 128, 142, 0.5) !important;
160+
@include _os_linuxDefaultThemeSelectedTab {
161+
box-shadow: $_os_linuxDefaultShadow !important;
156162
}
157-
#TabsToolbar:not([brighttext])
158-
#tabbrowser-tabs:not([noshadowfortests])
159-
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
160-
> .tab-stack
161-
> .tab-background:not(:-moz-lwtheme) {
162-
box-shadow: 0 0 1px var(--tab-line-color, rgba(128, 128, 142, 0.9)), 0 0 4px rgba(128, 128, 142, 0.5) !important;
163+
#TabsToolbar:not([brighttext]) {
164+
@include _os_linuxDefaultThemeSelectedTab {
165+
box-shadow: 0 0 1px var(--tab-line-color, rgba(128, 128, 142, 0.9)), $_os_linuxDefaultShadow !important;
166+
}
163167
}
164168
}
165169
}

src/compatibility/_theme.scss

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616
}
1717

1818
/*= Zoom in button's plus icon horizontal rate ===============================*/
19-
#customization-palette-container #zoom-in-button > .toolbarbutton-icon,
20-
#customization-panel-container #zoom-in-button > .toolbarbutton-icon,
21-
#widget-overflow-mainView #zoom-in-button > .toolbarbutton-icon {
22-
padding-inline-start: 0px !important;
19+
#customization-palette-container,
20+
#customization-panel-container,
21+
#widget-overflow-mainView {
22+
#zoom-in-button > .toolbarbutton-icon {
23+
padding-inline-start: 0px !important;
24+
}
2325
}
2426

2527
/*= Icon Fill Color ==========================================================*/
@@ -36,54 +38,63 @@
3638
}
3739

3840
/*= Disabled menu background color ===========================================*/
39-
menuitem[disabled="true"],
40-
menu[disabled="true"] {
41-
background-color: transparent !important;
41+
menuitem,
42+
menu {
43+
&[disabled="true"] {
44+
background-color: transparent !important;
45+
}
4246
}
4347

4448
/*= Remove Tab Border ========================================================*/
45-
@include Option("userChrome.tab.connect_to_window") {
46-
/* TARGET: original, photon */
47-
/* Light Theme */
48-
#TabsToolbar:not([brighttext])
49-
#tabbrowser-tabs:not([noshadowfortests])
50-
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
51-
> .tab-stack
52-
> .tab-background {
53-
border: unset !important; /* Nigtly 96: 1px solid var(--tab-line-color, rgba(128,128,142,0.9)); */
49+
@mixin _theme_removeTabBorder($options...) {
50+
%noneBorder {
51+
/* Nigtly 96: 1px solid var(--tab-line-color, rgba(128,128,142,0.9)); */
52+
border: unset !important;
5453
}
55-
56-
/* Dark Theme */
57-
#TabsToolbar[brighttext]
54+
@each $prefix, $postfix in $options {
55+
#TabsToolbar#{$prefix}
5856
#tabbrowser-tabs:not([noshadowfortests])
59-
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
60-
> .tab-stack
61-
> .tab-background:-moz-lwtheme {
62-
border: unset !important; /* Nigtly 96: 1px solid var(--tab-line-color, rgba(128,128,142,0.9)) */
57+
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
58+
> .tab-stack
59+
> .tab-background#{$postfix} {
60+
@extend %noneBorder;
61+
}
6362
}
6463
}
6564

65+
@include Option("userChrome.tab.connect_to_window") {
66+
/* TARGET: original, photon */
67+
@include _theme_removeTabBorder(
68+
// Light Theme
69+
":not([brighttext])",
70+
// Dark Theme
71+
"[brighttext]" ":-moz-lwtheme"
72+
);
73+
}
74+
6675
/*= Light Weight Theme =======================================================*/
6776
/* Header Image */
6877
:root[lwtheme-image] {
6978
background-image: var(--lwt-header-image) !important; /* Original: var(--lwt-header-image) */
7079
background-repeat: no-repeat !important;
7180
background-position: right top !important;
72-
}
73-
@media (min-width: 2500px) {
74-
:root[lwtheme-image] {
81+
82+
// For high-resolution screen's image ratio
83+
@media (min-width: 2500px) {
7584
background-size: contain;
7685

7786
@include Option("userChrome.compatibility.covered_header_image") {
7887
background-size: cover;
7988
}
8089
}
81-
}
82-
:root[lwtheme-image] #navigator-toolbox:-moz-lwtheme {
83-
background-image: var(--lwt-header-image), var(--lwt-additional-images) !important;
84-
background-repeat: var(--lwt-background-tiling) !important;
85-
background-position: var(--lwt-background-alignment) !important;
86-
background-color: unset !important; /* Original: var(--lwt-accent-color) */
90+
91+
// lwtheme compatibility
92+
#navigator-toolbox:-moz-lwtheme {
93+
background-image: var(--lwt-header-image), var(--lwt-additional-images) !important;
94+
background-repeat: var(--lwt-background-tiling) !important;
95+
background-position: var(--lwt-background-alignment) !important;
96+
background-color: unset !important; /* Original: var(--lwt-accent-color) */
97+
}
8798
}
8899

89100
/* Navbar Border */

0 commit comments

Comments
 (0)