Skip to content

Commit

Permalink
Merge branch 'refactoring' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
black7375 committed May 10, 2022
2 parents c236fe7 + 0d6ef76 commit 0eef12f
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 99 deletions.
31 changes: 11 additions & 20 deletions css/leptonChrome.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,18 @@
/*= Remove Tab Border ========================================================*/
@supports -moz-bool-pref("userChrome.tab.connect_to_window") {
/* TARGET: original, photon */
/* Light Theme */
#TabsToolbar:not([brighttext])
#TabsToolbar[brighttext]
#tabbrowser-tabs:not([noshadowfortests])
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
> .tab-stack
> .tab-background {
border: unset !important;
/* Nigtly 96: 1px solid var(--tab-line-color, rgba(128,128,142,0.9)); */
}

/* Dark Theme */
#TabsToolbar[brighttext]
> .tab-background:-moz-lwtheme,
#TabsToolbar:not([brighttext])
#tabbrowser-tabs:not([noshadowfortests])
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
> .tab-stack
> .tab-background:-moz-lwtheme {
> .tab-background {
/* Nigtly 96: 1px solid var(--tab-line-color, rgba(128,128,142,0.9)); */
border: unset !important;
/* Nigtly 96: 1px solid var(--tab-line-color, rgba(128,128,142,0.9)) */
}
}
/*= Light Weight Theme =======================================================*/
Expand All @@ -105,7 +99,6 @@
background-repeat: no-repeat !important;
background-position: right top !important;
}

@media (min-width: 2500px) {
:root[lwtheme-image] {
background-size: contain;
Expand Down Expand Up @@ -138,11 +131,9 @@
:root[sizemode="normal"][tabsintitlebar] #navigator-toolbox {
border-top: 0.5px solid #2f2f2f !important;
}

:root[sizemode="normal"][tabsintitlebar]:-moz-window-inactive #navigator-toolbox {
border-top-color: #393939 !important;
}

@media (-moz-windows-accent-color-in-titlebar) {
:root[sizemode="normal"][tabsintitlebar] #navigator-toolbox {
border-top-color: -moz-accent-color !important;
Expand All @@ -160,18 +151,19 @@
}
}
@media (-moz-os-version: windows-win7), (-moz-platform: windows-win7) {
#TabsToolbar:-moz-lwtheme {
color: var(--lwt-text-color) !important;
}

/* Remove Aero */
#TabsToolbar {
/* Remove Aero */
/* Original: radial-gradient(eclipse at bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.5) 80%, transparent) */
background-image: unset !important;
}
#TabsToolbar:-moz-lwtheme {
/* background textcolor */
color: var(--lwt-text-color) !important;
}
}
@media (-moz-os-version: windows-win8), (-moz-platform: windows-win8) {
#navigator-toolbox:-moz-lwtheme {
/* background textcolor */
color: var(--lwt-text-color) !important;
}
}
Expand Down Expand Up @@ -214,7 +206,6 @@
border: none !important;
/* Remove border */
}

#PlacesToolbar menu:not([disabled], :active)[_moz-menuactive="true"],
#PlacesToolbar menuitem:not([disabled], :active)[_moz-menuactive="true"],
#BMB_bookmarksPopup menu:not([disabled], :active)[_moz-menuactive="true"],
Expand Down
98 changes: 51 additions & 47 deletions src/compatibility/_os.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
/*= Windows 10 - Top border of accent color at ESR #358 ======================*/
@include OS($win10) {
:root[sizemode=normal][tabsintitlebar] #navigator-toolbox {
border-top: .5px solid rgb(47, 47, 47) !important;
}
:root[sizemode=normal][tabsintitlebar]:-moz-window-inactive #navigator-toolbox {
border-top-color: rgb(57, 57, 57) !important;
}
@media (-moz-windows-accent-color-in-titlebar) {
:root[sizemode=normal][tabsintitlebar] #navigator-toolbox {
border-top-color: -moz-accent-color !important;
:root[sizemode=normal][tabsintitlebar] {
#navigator-toolbox {
border-top: .5px solid rgb(47, 47, 47) !important;
}
&:-moz-window-inactive #navigator-toolbox {
border-top-color: rgb(57, 57, 57) !important;
}

@media (-moz-windows-accent-color-in-titlebar) {
#navigator-toolbox {
border-top-color: -moz-accent-color !important;
}
}
}
}
Expand All @@ -20,20 +23,25 @@
background-color: var(--lwt-accent-color) !important;
}
}
@include OS($win7) {
#TabsToolbar:-moz-lwtheme {
color: var(--lwt-text-color) !important;
}

/* Remove Aero */
@mixin _os_winTabBarTextColor {
/* background textcolor */
color: var(--lwt-text-color) !important;
}
@include OS($win7) {
#TabsToolbar {
&:-moz-lwtheme {
@include _os_winTabBarTextColor;
}

/* Remove Aero */
/* Original: radial-gradient(eclipse at bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.5) 80%, transparent) */
background-image: unset !important;
}
}
@include OS($win8) {
#navigator-toolbox:-moz-lwtheme {
color: var(--lwt-text-color) !important;
@include _os_winTabBarTextColor;
}
}

Expand Down Expand Up @@ -66,26 +74,27 @@
#BMB_bookmarksPopup menu,
#BMB_bookmarksPopup menuitem {
border: none !important; /* Remove border */
}
#PlacesToolbar menu:not([disabled], :active)[_moz-menuactive="true"],
#PlacesToolbar menuitem:not([disabled], :active)[_moz-menuactive="true"],
#BMB_bookmarksPopup menu:not([disabled], :active)[_moz-menuactive="true"],
#BMB_bookmarksPopup menuitem:not([disabled], :active)[_moz-menuactive="true"] {
background-color: var(--button-hover-bgcolor) !important;

&:not([disabled], :active)[_moz-menuactive="true"] {
background-color: var(--button-hover-bgcolor) !important;
}
}
}

@include OS($win7) {
@mixin _os_menuEmulate($bgRate, $bdRate) {
menu[_moz-menuactive="true"],
menuitem[_moz-menuactive="true"] {
background-color: color-mix(in srgb, -moz-menuhover 5%, transparent) !important;
border-color: color-mix(in srgb, -moz-menuhover 60%, transparent) !important;
background-color: color-mix(in srgb, -moz-menuhover $bgRate, transparent) !important;
border-color: color-mix(in srgb, -moz-menuhover $bdRate, transparent) !important;
}
menu[_moz-menuactive="true"][disabled="disabled"],
menuitem[_moz-menuactive="true"][disabled="true"] {
background-color: color-mix(in srgb, currentColor 5%, transparent) !important;
border-color: color-mix(in srgb, currentColor 60%, transparent) !important;
background-color: color-mix(in srgb, currentColor $bgRate, transparent) !important;
border-color: color-mix(in srgb, currentColor $bdRate, transparent) !important;
}
}
@include OS($win7) {
@include _os_menuEmulate(5%, 60%);

/* Remove text shadow */
:root:-moz-lwtheme #toolbar-menubar {
Expand All @@ -100,16 +109,7 @@
}
}
@include OS($win8) {
menu[_moz-menuactive="true"],
menuitem[_moz-menuactive="true"] {
background-color: color-mix(in srgb, -moz-menuhover 17%, transparent) !important;
border-color: color-mix(in srgb, -moz-menuhover 80%, transparent) !important;
}
menu[_moz-menuactive="true"][disabled="disabled"],
menuitem[_moz-menuactive="true"][disabled="true"] {
background-color: color-mix(in srgb, currentColor 17%, transparent) !important;
border-color: color-mix(in srgb, currentColor 80%, transparent) !important;
}
@include _os_menuEmulate(17%, 80%);
}

@include OS($linux) {
Expand Down Expand Up @@ -140,6 +140,15 @@
}

/*= Linux - Light System Default Theme's Selected Tab ========================*/
$_os_linuxDefaultShadow: 0 0 4px rgba(128, 128, 142, 0.5);
@mixin _os_linuxDefaultThemeSelectedTab {
#tabbrowser-tabs:not([noshadowfortests])
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
> .tab-stack
> .tab-background:not(:-moz-lwtheme) {
@content;
}
}
@include OS($linux) {
@include Light {
/* Because of
Expand All @@ -148,18 +157,13 @@
box-shadow: 0 0 4px rgba(128,128,142,0.5);
}
*/
#tabbrowser-tabs:not([noshadowfortests])
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
> .tab-stack
> .tab-background:not(:-moz-lwtheme) {
box-shadow: 0 0 4px rgba(128, 128, 142, 0.5) !important;
@include _os_linuxDefaultThemeSelectedTab {
box-shadow: $_os_linuxDefaultShadow !important;
}
#TabsToolbar:not([brighttext])
#tabbrowser-tabs:not([noshadowfortests])
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
> .tab-stack
> .tab-background:not(:-moz-lwtheme) {
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;
#TabsToolbar:not([brighttext]) {
@include _os_linuxDefaultThemeSelectedTab {
box-shadow: 0 0 1px var(--tab-line-color, rgba(128, 128, 142, 0.9)), $_os_linuxDefaultShadow !important;
}
}
}
}
75 changes: 43 additions & 32 deletions src/compatibility/_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
}

/*= Zoom in button's plus icon horizontal rate ===============================*/
#customization-palette-container #zoom-in-button > .toolbarbutton-icon,
#customization-panel-container #zoom-in-button > .toolbarbutton-icon,
#widget-overflow-mainView #zoom-in-button > .toolbarbutton-icon {
padding-inline-start: 0px !important;
#customization-palette-container,
#customization-panel-container,
#widget-overflow-mainView {
#zoom-in-button > .toolbarbutton-icon {
padding-inline-start: 0px !important;
}
}

/*= Icon Fill Color ==========================================================*/
Expand All @@ -36,54 +38,63 @@
}

/*= Disabled menu background color ===========================================*/
menuitem[disabled="true"],
menu[disabled="true"] {
background-color: transparent !important;
menuitem,
menu {
&[disabled="true"] {
background-color: transparent !important;
}
}

/*= Remove Tab Border ========================================================*/
@include Option("userChrome.tab.connect_to_window") {
/* TARGET: original, photon */
/* Light Theme */
#TabsToolbar:not([brighttext])
#tabbrowser-tabs:not([noshadowfortests])
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
> .tab-stack
> .tab-background {
border: unset !important; /* Nigtly 96: 1px solid var(--tab-line-color, rgba(128,128,142,0.9)); */
@mixin _theme_removeTabBorder($options...) {
%noneBorder {
/* Nigtly 96: 1px solid var(--tab-line-color, rgba(128,128,142,0.9)); */
border: unset !important;
}

/* Dark Theme */
#TabsToolbar[brighttext]
@each $prefix, $postfix in $options {
#TabsToolbar#{$prefix}
#tabbrowser-tabs:not([noshadowfortests])
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
> .tab-stack
> .tab-background:-moz-lwtheme {
border: unset !important; /* Nigtly 96: 1px solid var(--tab-line-color, rgba(128,128,142,0.9)) */
.tabbrowser-tab:is([visuallyselected="true"], [multiselected])
> .tab-stack
> .tab-background#{$postfix} {
@extend %noneBorder;
}
}
}

@include Option("userChrome.tab.connect_to_window") {
/* TARGET: original, photon */
@include _theme_removeTabBorder(
// Light Theme
":not([brighttext])",
// Dark Theme
"[brighttext]" ":-moz-lwtheme"
);
}

/*= Light Weight Theme =======================================================*/
/* Header Image */
:root[lwtheme-image] {
background-image: var(--lwt-header-image) !important; /* Original: var(--lwt-header-image) */
background-repeat: no-repeat !important;
background-position: right top !important;
}
@media (min-width: 2500px) {
:root[lwtheme-image] {

// For high-resolution screen's image ratio
@media (min-width: 2500px) {
background-size: contain;

@include Option("userChrome.compatibility.covered_header_image") {
background-size: cover;
}
}
}
:root[lwtheme-image] #navigator-toolbox:-moz-lwtheme {
background-image: var(--lwt-header-image), var(--lwt-additional-images) !important;
background-repeat: var(--lwt-background-tiling) !important;
background-position: var(--lwt-background-alignment) !important;
background-color: unset !important; /* Original: var(--lwt-accent-color) */

// lwtheme compatibility
#navigator-toolbox:-moz-lwtheme {
background-image: var(--lwt-header-image), var(--lwt-additional-images) !important;
background-repeat: var(--lwt-background-tiling) !important;
background-position: var(--lwt-background-alignment) !important;
background-color: unset !important; /* Original: var(--lwt-accent-color) */
}
}

/* Navbar Border */
Expand Down

0 comments on commit 0eef12f

Please sign in to comment.