Add: Theme - PDF contents darkmode

This commit is contained in:
alstjr7375 2023-02-15 02:54:33 +09:00
parent 5415e5d568
commit 5c14948aa4
6 changed files with 49 additions and 1 deletions

View file

@ -175,6 +175,11 @@ W: https://github.com/MrOtherGuy/firefox-csshacks
C: Copyright (c) 2018 MrOtherGuy
L: MPL 2.0
N: Firefox Custom CSS
W: https://github.com/hakan-demirli/Firefox_Custom_CSS
C: Copyright (c) 2022 hakan-demirli
L: MIT
N: Fluent UI System Icons
W: https://github.com/microsoft/fluentui-system-icons
C: Copyright (c) 2020 Microsoft Corporation

View file

@ -6,6 +6,9 @@
@include test("simple") {
@include assert {
@include output {
@include moz-document(unobservable-document) {
@include example;
}
@include moz-document(url "about:downloads") {
@include example;
}
@ -17,6 +20,9 @@
}
}
@include expect {
@-moz-document #{unobservable-document()} { // Invalid function name.
@include example;
}
@-moz-document url("about:downloads") {
@include example;
}

View file

@ -1640,6 +1640,23 @@
box-shadow: 0 0 0 3px color-mix(in srgb, var(--in-content-primary-button-background-hover) 80%, transparent) !important;
}
}
@supports -moz-bool-pref("userContent.page.dark_mode.pdf") {
@-moz-document unobservable-document() {
@-moz-document regexp("^(?!.*\\.pdf\\?n).*") {
#outerContainer {
--sidebaritem-bg-color: #38383d;
--uc-pdf-dark-filter: grayscale(10%) invert(90%);
}
#sidebarContainer > #sidebarContent > #thumbnailView .thumbnailImage {
filter: var(--uc-pdf-dark-filter);
box-shadow: 0 0 0 1px hsla(0deg, 0%, 100%, 0.5), 0 2px 8px hsla(0deg, 0%, 100%, 0.3) !important;
}
#viewerContainer > #viewer > .page > .canvasWrapper > canvas {
filter: var(--uc-pdf-dark-filter);
}
}
}
}
}
}
/** Fully Proton Mode *********************************************************/

View file

@ -2,4 +2,23 @@
@import "dark_mode/addons_org";
@import "dark_mode/support_org";
@import "dark_mode/accounts_com";
@include Option("userContent.page.dark_mode.pdf") {
@include moz-document(unobservable-document) {
@include moz-document(regexp "^(?!.*\\.pdf\\?n).*") {
#outerContainer {
--sidebaritem-bg-color: #38383D;
--uc-pdf-dark-filter: grayscale(10%) invert(90%);
}
#sidebarContainer > #sidebarContent > #thumbnailView .thumbnailImage {
filter: var(--uc-pdf-dark-filter);
box-shadow: 0 0 0 1px hsla(0, 0%, 100%, 0.5), 0 2px 8px hsla(0, 0%, 100%, 0.3) !important;
}
#viewerContainer > #viewer > .page > .canvasWrapper > canvas {
filter: var(--uc-pdf-dark-filter);
}
}
}
}
}

View file

@ -1,7 +1,7 @@
@mixin moz-document($urlList...) {
$result: ();
@each $prefix, $urlPattern in $urlList {
$result: append($result, #{$prefix}("#{$urlPattern}"), $separator: comma);
$result: append($result, #{$prefix}(if($urlPattern, "#{$urlPattern}", null)), $separator: comma);
}
@#{-moz-document} #{$result} {

View file

@ -206,6 +206,7 @@ user_pref("userChrome.rounding.square_tab", false);
// user_pref("userContent.page.proton_color.dark_blue_accent", true);
// user_pref("userContent.page.proton_color.system_accent", true);
// user_pref("userContent.page.dark_mode.pdf", true);
// user_pref("userContent.page.monospace", true);
// == Theme Default Settings ===================================================