summaryrefslogtreecommitdiff
path: root/inject-css.js
diff options
context:
space:
mode:
authorsameerasw <[email protected]>2025-03-05 17:55:45 +0530
committersameerasw <[email protected]>2025-03-05 17:55:45 +0530
commitbbeae845b702727f0ffaf3e49c85ed9bc0f971ab (patch)
tree67552b6f6fd88568862fdf61dc6bb50060f60fc6 /inject-css.js
parent34e74fda832756db278b43fa9b0e0cfb99430f8a (diff)
Wildcards for forcing theme on unthemed websites
Diffstat (limited to 'inject-css.js')
-rw-r--r--inject-css.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/inject-css.js b/inject-css.js
index 3246255..88ddacc 100644
--- a/inject-css.js
+++ b/inject-css.js
@@ -19,7 +19,7 @@ if (logging) console.log("inject-css.js script loaded");
const currentUrl = window.location.hostname;
if (logging) console.log("Current URL hostname", currentUrl);
- const cssFileName = Object.keys(data.styles?.website || {}).find((key) => {
+ let cssFileName = Object.keys(data.styles?.website || {}).find((key) => {
const siteName = key.replace(".css", "");
if (siteName.startsWith("+")) {
const baseSiteName = siteName.slice(1);
@@ -28,6 +28,10 @@ if (logging) console.log("inject-css.js script loaded");
return currentUrl === siteName || currentUrl === `www.${siteName}`;
});
+ if (!cssFileName && settings.transparentZenSettings?.forceStyling) {
+ cssFileName = "example.com.css";
+ }
+
if (!cssFileName) {
if (logging) console.log("No CSS file found for current site");
return;