Skip to content

Commit 18f3227

Browse files
committed
fix: default-gray theme's header background color via a file-modifier.
1 parent 9504b4a commit 18f3227

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

api/src/unraid-api/unraid-file-modifier/modifications/__test__/snapshots/default-gray.css.modified.snapshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ select.slot{min-width:44rem;max-width:44rem}
4949
input.narrow{width:174px}
5050
input.trim{width:74px;min-width:74px}
5151
textarea{resize:none}
52-
#header{position:fixed;top:0;left:0;width:100%;height:90px;z-index:100;margin:0;background-color:#121510;background-size:100% 90px;background-repeat:no-repeat;border-bottom:1px solid #42453e}
52+
#header{position:fixed;top:0;left:0;width:100%;height:90px;z-index:100;margin:0;background-color:#f2f2f2;background-size:100% 90px;background-repeat:no-repeat;border-bottom:1px solid #42453e}
5353
#header .logo{float:left;margin-left:75px;color:#e22828;text-align:center}
5454
#header .logo svg{width:160px;display:block;margin:25px 0 8px 0}
5555
#header .block{margin:0;float:right;text-align:right;background-color:rgba(18,21,16,0.2);padding:10px 12px}

api/src/unraid-api/unraid-file-modifier/modifications/default-gray-css.modification.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ export default class DefaultGrayCssModification extends FileModification {
4848
const insertIndex = bodyEndIndex + 1;
4949

5050
const before = source.slice(0, insertIndex);
51-
const after = source.slice(insertIndex);
51+
let after = source.slice(insertIndex);
52+
53+
// Replace #header background-color ONLY for default-gray.css
54+
after = after.replace(/(#header\s*\{[^}]*background-color:)#121510/, '$1#f2f2f2');
5255

5356
return `${before}\n@layer default {\n@scope (:root) to (.unapi) {${after}\n}\n}`;
5457
}

api/src/unraid-api/unraid-file-modifier/modifications/patches/default-gray-css-modification.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ Index: /usr/local/emhttp/plugins/dynamix/styles/default-gray.css
1212
p.centered{text-align:left}
1313
p:empty{display:none}
1414
a:hover{text-decoration:underline}
15+
@@ -45,11 +47,11 @@
16+
select.auto{min-width:auto}
17+
select.slot{min-width:44rem;max-width:44rem}
18+
input.narrow{width:174px}
19+
input.trim{width:74px;min-width:74px}
20+
textarea{resize:none}
21+
-#header{position:fixed;top:0;left:0;width:100%;height:90px;z-index:100;margin:0;background-color:#121510;background-size:100% 90px;background-repeat:no-repeat;border-bottom:1px solid #42453e}
22+
+#header{position:fixed;top:0;left:0;width:100%;height:90px;z-index:100;margin:0;background-color:#f2f2f2;background-size:100% 90px;background-repeat:no-repeat;border-bottom:1px solid #42453e}
23+
#header .logo{float:left;margin-left:75px;color:#e22828;text-align:center}
24+
#header .logo svg{width:160px;display:block;margin:25px 0 8px 0}
25+
#header .block{margin:0;float:right;text-align:right;background-color:rgba(18,21,16,0.2);padding:10px 12px}
26+
#header .text-left{float:left;text-align:right;padding-right:5px;border-right:solid medium #f15a2c}
27+
#header .text-right{float:right;text-align:left;padding-left:5px}
1528
@@ -270,5 +272,8 @@
1629
.bannerInfo::before {content:"\f05a";font-family:fontAwesome;color:#e68a00}
1730
::-webkit-scrollbar{width:8px;height:8px;background:transparent}

0 commit comments

Comments
 (0)