Add OLED theme (#658)

This commit is contained in:
redphx
2025-02-04 20:20:48 +07:00
parent 664e865b82
commit 7a69e7f284
8 changed files with 53 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
import { CE } from "@utils/html";
import { compressCss, isLiteVersion, renderStylus } from "@macros/build" with { type: "macro" };
import { BlockFeature, UiSection } from "@/enums/pref-values";
import { BlockFeature, UiSection, UiTheme } from "@/enums/pref-values";
import { GlobalPref } from "@/enums/pref-keys";
import { getGlobalPref } from "./pref-utils";
import { containsAll } from "./utils";
@@ -69,6 +69,19 @@ export function addCss() {
css += selectorToHide.join(',') + '{ display: none; }';
}
// Change site's background
if (getGlobalPref(GlobalPref.UI_THEME) === UiTheme.DARK_OLED) {
css += compressCss(`
body[data-theme=dark] {
--gds-containerSolidAppBackground: #000 !important;
}
div[class*="ProductDetailPage-module__backgroundImageGradient"]:after {
background: radial-gradient(ellipse 100% 100% at 50% 0, #1515178c 0, #1a1b1ea6 32%, #000000 100%) !important;
}
`);
}
// Reduce animations
if (getGlobalPref(GlobalPref.UI_REDUCE_ANIMATIONS)) {
css += compressCss(`