Skip to content

Commit ee2a7c7

Browse files
committed
more theme fixes and font colours
1 parent 4939450 commit ee2a7c7

17 files changed

+66
-9
lines changed

public/themes/dark-high-contrast.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
--bg-modal: #000000;
6969
--bg-modal-overlay: rgba(0, 0, 0, 0.9);
7070
--color-text-primary: #ffffff;
71+
--color-text-modal: #ffffff;
7172
--color-text-muted: #cccccc;
7273
--color-text-muted-dark: #aaaaaa;
7374
--bg-card: rgba(255, 255, 255, 0.1);

public/themes/default.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
--bg-modal: #1e1e1e;
6969
--bg-modal-overlay: rgba(0, 0, 0, 0.5);
7070
--color-text-primary: white;
71+
--color-text-modal: #ffffff; /* keep modal text light for dark modal background */
7172
--color-text-muted: #bdbdbd;
7273
--color-text-muted-dark: #9a9a9a;
7374
--bg-card: rgba(255, 255, 255, 0.02);
@@ -137,5 +138,7 @@
137138
--bg-root: #ffffff;
138139
--btn-standard-hover: #f9f9f9;
139140
--link-hover: #747bff;
141+
/* Do NOT darken modal text in light mode; modal bg remains dark */
142+
--color-text-modal: #ffffff;
140143
}
141144
}

public/themes/jade-green.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
--bg-modal: #1a2e1a;
6969
--bg-modal-overlay: rgba(10, 21, 10, 0.7);
7070
--color-text-primary: #e8f8e8;
71+
--color-text-modal: #e8f8e8;
7172
--color-text-muted: #a8c8a8;
7273
--color-text-muted-dark: #7a9a7a;
7374
--bg-card: rgba(74, 158, 74, 0.08);
@@ -137,5 +138,6 @@
137138
--bg-root: #f0f8f0;
138139
--btn-standard-hover: #e8f8e8;
139140
--link-hover: #6abe6a;
141+
--color-text-modal: #e8f8e8; /* modal bg remains dark */
140142
}
141143
}

public/themes/ocean-blue.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
--bg-modal: #0f1822;
6969
--bg-modal-overlay: rgba(10, 16, 21, 0.7);
7070
--color-text-primary: #e8f4f8;
71+
--color-text-modal: #e8f4f8;
7172
--color-text-muted: #a8c5d1;
7273
--color-text-muted-dark: #7a9aaa;
7374
--bg-card: rgba(74, 144, 226, 0.08);
@@ -137,5 +138,6 @@
137138
--bg-root: #f0f8ff;
138139
--btn-standard-hover: #e8f4f8;
139140
--link-hover: #6ab0ff;
141+
--color-text-modal: #e8f4f8; /* modal bg remains dark */
140142
}
141143
}

public/themes/sunset-orange.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
--bg-modal: #2a1810;
6969
--bg-modal-overlay: rgba(26, 15, 8, 0.7);
7070
--color-text-primary: #ffe8d8;
71+
--color-text-modal: #ffe8d8;
7172
--color-text-muted: #c9a890;
7273
--color-text-muted-dark: #a98870;
7374
--bg-card: rgba(255, 140, 66, 0.08);
@@ -137,5 +138,6 @@
137138
--bg-root: #fff8f0;
138139
--btn-standard-hover: #ffe8d8;
139140
--link-hover: #ffac62;
141+
--color-text-modal: #ffe8d8; /* modal bg remains dark */
140142
}
141143
}

src/components/aboutModal.css

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
.modal-content.about-modal {
1313
background-color: var(--bg-modal);
14-
color: var(--color-text-primary);
14+
color: var(--color-text-modal);
1515
padding: 20px;
1616
border-radius: 8px;
1717
width: 1500px;
@@ -24,6 +24,19 @@
2424
align-items: center;
2525
}
2626

27+
/* Ensure all text inside the About modal stays readable */
28+
.about-modal,
29+
.about-modal p,
30+
.about-modal li,
31+
.about-modal h1,
32+
.about-modal h2,
33+
.about-modal h3,
34+
.about-modal h4,
35+
.about-modal h5,
36+
.about-modal h6 {
37+
color: var(--color-text-modal);
38+
}
39+
2740
.about-hero-logo img {
2841
width: 64px;
2942
height: 64px;
@@ -46,12 +59,13 @@
4659

4760
.badge {
4861
display: inline-block;
49-
background: var(--color-primary-light);
50-
color: var(--color-text-primary);
62+
background: var(--bg-card);
63+
color: var(--color-text-modal);
5164
padding: 4px 8px;
5265
margin-right: 6px;
5366
border-radius: 4px;
54-
font-size: 12px
67+
border: 1px solid var(--border-card);
68+
font-size: 12px;
5569
}
5670

5771
.about-grid {
@@ -98,7 +112,7 @@
98112

99113
.btn.primary {
100114
background: var(--btn-primary-modal);
101-
color: var(--color-text-primary);
115+
color: var(--btn-primary-modal-text);
102116
padding: 8px 12px;
103117
border-radius: 6px;
104118
border: none;

src/components/featuresModal.css

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
.features-subtitle { color:var(--color-text-muted); margin-top:4px }
55
.features-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-top:16px }
66
.feature-card { background: var(--bg-card); padding:12px; border:2px solid var(--border-card-light); border-radius:8px }
7-
.features-modal { padding:20px; width:1500px; max-width:95vw }
7+
.features-modal { padding:20px; width:1500px; max-width:95vw; background-color: var(--bg-modal); color: var(--color-text-modal); border-radius: 8px }
88

99
.modal-overlay {
1010
position: fixed;
@@ -15,3 +15,22 @@
1515
align-items: center;
1616
z-index: 1000001; /* above dropdown portals */
1717
}
18+
19+
/* Ensure all text inside the Features modal stays readable */
20+
.features-modal,
21+
.features-modal p,
22+
.features-modal li,
23+
.features-modal h1,
24+
.features-modal h2,
25+
.features-modal h3,
26+
.features-modal h4,
27+
.features-modal h5,
28+
.features-modal h6 {
29+
color: var(--color-text-modal);
30+
}
31+
32+
/* Buttons inside modal */
33+
.features-modal .btn.primary {
34+
background: var(--btn-primary-modal);
35+
color: var(--btn-primary-modal-text);
36+
}

src/components/passwordModal.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@
5050

5151
.cancel-button {
5252
background-color: var(--btn-cancel);
53-
color: var(--color-text-primary);
53+
color: var(--btn-primary-modal-text);
5454
margin-right: 10px;
5555
}
5656

5757
.submit-button {
5858
background-color: var(--btn-submit);
59-
color: var(--color-text-primary);
59+
color: var(--btn-primary-modal-text);
6060
}
6161

src/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
text-rendering: optimizeLegibility;
1212
-webkit-font-smoothing: antialiased;
1313
-moz-osx-font-smoothing: grayscale;
14+
15+
/* Fallbacks: ensure modal text is readable if a theme doesn't define it */
16+
--color-text-modal: var(--color-text-primary, #ffffff);
1417
}
1518

1619
a {

src/themeLoader.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ export const loadTheme = (themeName: string, isCustom: boolean = false) => {
2020
// Load built-in theme
2121
const link = document.createElement('link');
2222
link.rel = 'stylesheet';
23-
link.href = `/themes/${themeName}.css`;
23+
// Build URL using Vite base so it works both locally and on GitHub Pages (/EasyEdit/webapp/).
24+
// Avoid URL() constructor because BASE_URL may be relative (e.g. '/'), which is invalid as a base.
25+
const base = (import.meta.env.BASE_URL || '/');
26+
const normalizedBase = base.endsWith('/') ? base : `${base}/`;
27+
link.href = `${normalizedBase}themes/${themeName}.css`;
2428
link.setAttribute('data-theme', themeName);
2529
document.head.appendChild(link);
2630
}

0 commit comments

Comments
 (0)