From ba1092e2fe8718f5d9b6d4fc445210551b8a1d3b Mon Sep 17 00:00:00 2001 From: alstjr7375 Date: Tue, 22 Mar 2022 05:41:37 +0900 Subject: [PATCH] Clean: SASS - system default theme --- src/theme/proton_chrome/_proton_commons.scss | 3 +- src/theme/system_default_theme/_mac.scss | 20 ++++---------- src/theme/system_default_theme/_win10.scss | 29 ++++++-------------- 3 files changed, 16 insertions(+), 36 deletions(-) diff --git a/src/theme/proton_chrome/_proton_commons.scss b/src/theme/proton_chrome/_proton_commons.scss index bc9fac6..e3c0fcf 100644 --- a/src/theme/proton_chrome/_proton_commons.scss +++ b/src/theme/proton_chrome/_proton_commons.scss @@ -14,8 +14,7 @@ } } - :root:not(:-moz-lwtheme), - :root[lwt-default-theme-in-dark-mode] { + #{system-default-theme()} { --checkbox-unchecked-bgcolor: var(--in-content-button-background) !important; --checkbox-unchecked-hover-bgcolor: var(--in-content-button-background-hover) !important; --checkbox-unchecked-active-bgcolor: var(--in-content-button-background-active) !important; diff --git a/src/theme/system_default_theme/_mac.scss b/src/theme/system_default_theme/_mac.scss index 49d1640..efb7975 100644 --- a/src/theme/system_default_theme/_mac.scss +++ b/src/theme/system_default_theme/_mac.scss @@ -1,7 +1,6 @@ /*= Mac - Default like color =================================================*/ @include OS($mac) { - :root:not(:-moz-lwtheme), - :root[lwt-default-theme-in-dark-mode] { + #{system-default-theme()} { /* Colors */ --mac-text-color: -moz-dialogtext; --mac-disabled-color: GrayText; @@ -162,8 +161,7 @@ } /*- Proton Tab Selected ----------------------------------------------------*/ @include Option("userChrome.tab.proton") { - :root:not(:-moz-lwtheme), - :root[lwt-default-theme-in-dark-mode] { + #{system-default-theme()} { --mac-proton-tab-selected-bgcolor: color-mix(in srgb, rgb(255, 255, 255) 20%, -moz-dialog); } :root:not(:-moz-lwtheme) { @@ -175,16 +173,14 @@ } /*- Toolbar ----------------------------------------------------------------*/ - :root:not(:-moz-lwtheme) #navigator-toolbox, - :root[lwt-default-theme-in-dark-mode] #navigator-toolbox { + #{selector.nest(system-default-theme(), "#navigator-toolbox")} { background-color: var(--mac-bgcolor) !important; } :root:not(:-moz-lwtheme) #titlebar { --mac-hover-bgcolor: ButtonFace; } - :root:not(:-moz-lwtheme) #titlebar, - :root[lwt-default-theme-in-dark-mode] #titlebar { + #{selector.nest(system-default-theme(), "#titlebar")} { --button-hover-bgcolor: var(--mac-hover-bgcolor); --button-active-bgcolor: var(--mac-hover-bgcolor); --toolbarbutton-hover-background: var(--mac-hover-bgcolor); @@ -203,8 +199,7 @@ #sidebar-box:not([lwt-sidebar]) { appearance: none !important; } - :root:not(:-moz-lwtheme) #sidebar-box, - :root[lwt-default-theme-in-dark-mode] #sidebar-box { + #{selector.nest(system-default-theme(), "#sidebar-box")} { --sidebar-background-color: var(--mac-sidebar-bgcolor) !important; --sidebar-text-color: var(--mac-text-color) !important; /* --sidebar-border-color: var(--win-sidebar-border-color) !important; */ @@ -251,10 +246,7 @@ } } - :root:not([customizing="true"]):not(:-moz-lwtheme) tab[visuallyselected] > stack::before, - :root:not([customizing="true"]):not(:-moz-lwtheme) tab[visuallyselected] > stack::after, - :root:not([customizing="true"])[lwt-default-theme-in-dark-mode] tab[visuallyselected] > stack::before, - :root:not([customizing="true"])[lwt-default-theme-in-dark-mode] tab[visuallyselected] > stack::after { + #{selector.append(system-default-theme(), ":not([customizing=true]) tab[visuallyselected] > stack", "::before, ::after")} { fill: color-mix(in srgb, rgb(255, 255, 255) 15%, -moz-dialog) !important; } } diff --git a/src/theme/system_default_theme/_win10.scss b/src/theme/system_default_theme/_win10.scss index 833d064..9b63909 100644 --- a/src/theme/system_default_theme/_win10.scss +++ b/src/theme/system_default_theme/_win10.scss @@ -28,8 +28,7 @@ --win-accent-active-color: -moz-accent-color; } @include Dark { - :root:not(:-moz-lwtheme), - :root[lwt-default-theme-in-dark-mode] { + #{system-default-theme()} { --win-text-color: #ffffff; --win-bgcolor: #2b2b2b; --win-disabled-color: #747474; @@ -57,8 +56,7 @@ } } - :root:not(:-moz-lwtheme), - :root[lwt-default-theme-in-dark-mode] { + #{system-default-theme()} { /* Text, Icon Color */ --menu-color: var(--win-text-color) !important; --lwt-text-color: var(--win-text-color) !important; @@ -198,8 +196,7 @@ /*- Proton Tab Selected ----------------------------------------------------*/ @include Option($tabProton) { - :root:not(:-moz-lwtheme), - :root[lwt-default-theme-in-dark-mode] { + #{system-default-theme()} { --win-proton-tab-selected-bgcolor: color-mix(in srgb, var(--win-bgcolor) 5%, var(--win-component-bgcolor)); } :root:not(:-moz-lwtheme) { @@ -221,8 +218,7 @@ } /*- Toolbar ----------------------------------------------------------------*/ - :root:not(:-moz-lwtheme) #titlebar, - :root[lwt-default-theme-in-dark-mode] #titlebar { + #{selector.nest(system-default-theme(), "#titlebar")} { --button-hover-bgcolor: var(--win-sidebar-button-hover-bgcolor); --button-active-bgcolor: var(--win-sidebar-button-hover-active-bgcolor); --toolbarbutton-hover-background: var(--win-sidebar-button-hover-bgcolor); @@ -233,8 +229,7 @@ #sidebar-box:not([lwt-sidebar]) { appearance: none !important; } - :root:not(:-moz-lwtheme) #sidebar-box, - :root[lwt-default-theme-in-dark-mode] #sidebar-box { + #{selector.nest(system-default-theme(), "#sidebar-box")} { --sidebar-background-color: var(--win-sidebar-bgcolor) !important; --sidebar-text-color: var(--win-text-color) !important; --sidebar-border-color: var(--win-border-color) !important; @@ -251,22 +246,16 @@ } /*- Panel ------------------------------------------------------------------*/ - :root:not(:-moz-lwtheme) .subviewbutton, - :root[lwt-default-theme-in-dark-mode] .subviewbutton { + #{selector.nest(system-default-theme(), ".subviewbutton")} { --button-hover-bgcolor: var(--win-hover-active-bgcolor) !important; --button-active-bgcolor: var(--win-button-active-bgcolor) !important; } - :root:not(:-moz-lwtheme) - toolbarbutton.subviewbutton:not([disabled], [open], :active, #appMenu-fxa-label2, #appMenu-zoomReduce-button2, #appMenu-zoomReset-button2, #appMenu-zoomEnlarge-button2, #appMenu-fullscreen-button2):is(:hover), - :root[lwt-default-theme-in-dark-mode] - toolbarbutton.subviewbutton:not([disabled], [open], :active, #appMenu-fxa-label2, #appMenu-zoomReduce-button2, #appMenu-zoomReset-button2, #appMenu-zoomEnlarge-button2, #appMenu-fullscreen-button2):is(:hover) { + $panelZoomButtons: "#appMenu-fxa-label2, #appMenu-zoomReduce-button2, #appMenu-zoomReset-button2, #appMenu-zoomEnlarge-button2, #appMenu-fullscreen-button2"; + #{selector.nest(system-default-theme(), "toolbarbutton.subviewbutton:not([disabled], [open], :active, #{$panelZoomButtons}):is(:hover)")} { background-color: var(--win-hover-bgcolor) !important; } - :root:not(:-moz-lwtheme) - toolbarbutton.subviewbutton:not([disabled], #appMenu-fxa-label2, #appMenu-zoomReduce-button2, #appMenu-zoomReset-button2, #appMenu-zoomEnlarge-button2, #appMenu-fullscreen-button2):is([open], :hover:active), - :root[lwt-default-theme-in-dark-mode] - toolbarbutton.subviewbutton:not([disabled], #appMenu-fxa-label2, #appMenu-zoomReduce-button2, #appMenu-zoomReset-button2, #appMenu-zoomEnlarge-button2, #appMenu-fullscreen-button2):is([open], :hover:active) { + #{selector.nest(system-default-theme(), "toolbarbutton.subviewbutton:not([disabled], #{$panelZoomButtons}):is([open], :hover:active)")} { background-color: var(--win-hover-active-bgcolor) !important; }