diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index 0969469..ea03c2b 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -146,6 +146,9 @@
"todo_full_height": {
"message": "Force Full Height"
},
+ "todo_alternate_colors": {
+ "message": "Alternate colors"
+ },
"relative_due_dates": {
"message": "Relative Due Dates"
},
diff --git a/html/popup.html b/html/popup.html
index baeed41..5f125e5 100644
--- a/html/popup.html
+++ b/html/popup.html
@@ -250,6 +250,10 @@
+
+
+
+
Max items to show:
diff --git a/js/content.js b/js/content.js
index 15cd8c6..cc0c14e 100644
--- a/js/content.js
+++ b/js/content.js
@@ -565,6 +565,7 @@ function startExtension() {
chrome.storage.sync.get(null, result => {
options = { ...options, ...result };
+ applyTodoAlternateColors();
toggleAutoDarkMode();
// toggleScheduledReminders();
getApiData();
@@ -608,6 +609,10 @@ function applyOptionsChanges(changes) {
case "dark_preset":
case "device_dark":
toggleDarkMode();
+ applyTodoAlternateColors();
+ break;
+ case "todo_alternate_colors":
+ applyTodoAlternateColors();
break;
case "auto_dark":
case "auto_dark_start":
@@ -2723,6 +2728,24 @@ function clearTodoList() {
});
}
+// "Alternate colors" (Better Todo List, light mode only): recolors the main
+// todo-list icon fill to white instead of the default --bctext-0, so icons
+// stay visible on lighter course-color strips. Implemented through a CSS
+// variable so toggling the option or dark mode recolors existing icons live
+// without a re-render.
+const TODO_ALT_ICON_COLOR = "#ffffff";
+let todoAltStyleEl = null;
+function applyTodoAlternateColors() {
+ const altOn = options.todo_alternate_colors === true && options.dark_mode !== true;
+ const color = altOn ? TODO_ALT_ICON_COLOR : "var(--bctext-0)";
+ if (!todoAltStyleEl) {
+ todoAltStyleEl = document.createElement("style");
+ todoAltStyleEl.id = "crtodoaltcss";
+ document.documentElement.append(todoAltStyleEl);
+ }
+ todoAltStyleEl.textContent = `:root{--cr-todo-icon:${color};}`;
+}
+
function populateAssignments(iscompleted = false) {
const today = new Date();
today.setHours(0,0,0,0);
@@ -2801,9 +2824,9 @@ function populateAssignments(iscompleted = false) {
const iconLeftOffset = isCustomTask ? 2 : 5;
const taskIcon = isCustomTask
? `
`
- : `