fix: subreddit badge fill, tagline 'to' cleanup, and comments li spacing
- Default subreddit badge background from transparent to opaque fill (light: #fde8e0, dark: #3d2518) so page highlights don't bleed through - Remove lingering "to" text node from tagline when subreddit is hidden - Hide the <li> wrapping the comments link (not just the <a>) to eliminate leftover whitespace in the flat-list - Simplify popup: subreddit bg fields are now color pickers (no longer need transparent text-input workaround) Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,11 +2,13 @@
|
||||
"use strict";
|
||||
|
||||
const COLOR_KEYS = [
|
||||
"light.subredditBgColor",
|
||||
"light.subredditBorderColor",
|
||||
"light.subredditTextColor",
|
||||
"light.commentsBgColor",
|
||||
"light.commentsBorderColor",
|
||||
"light.commentsTextColor",
|
||||
"dark.subredditBgColor",
|
||||
"dark.subredditBorderColor",
|
||||
"dark.subredditTextColor",
|
||||
"dark.commentsBgColor",
|
||||
@@ -14,13 +16,8 @@
|
||||
"dark.commentsTextColor",
|
||||
];
|
||||
|
||||
const BG_KEYS = [
|
||||
"light.subredditBgColor",
|
||||
"dark.subredditBgColor",
|
||||
];
|
||||
|
||||
function colorToHex(val) {
|
||||
if (!val || val === "transparent") return "#ffffff";
|
||||
if (!val) return "#ffffff";
|
||||
return val;
|
||||
}
|
||||
|
||||
@@ -33,14 +30,6 @@
|
||||
if (el) el.value = colorToHex(settings[key]);
|
||||
});
|
||||
|
||||
BG_KEYS.forEach(function (key) {
|
||||
const el = document.getElementById(key);
|
||||
if (el) {
|
||||
el.value = settings[key] === "transparent" ? "" : settings[key];
|
||||
el.placeholder = "transparent";
|
||||
}
|
||||
});
|
||||
|
||||
renderSubredditOverrides(settings.subredditColors || {});
|
||||
}
|
||||
|
||||
@@ -127,13 +116,6 @@
|
||||
if (el) settings[key] = el.value;
|
||||
});
|
||||
|
||||
BG_KEYS.forEach(function (key) {
|
||||
const el = document.getElementById(key);
|
||||
if (el) {
|
||||
settings[key] = el.value.trim() || "transparent";
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
await window.RedditTweaks.saveSettings(settings);
|
||||
} catch (err) {
|
||||
@@ -153,11 +135,6 @@
|
||||
if (el) el.addEventListener("input", saveFromControls);
|
||||
});
|
||||
|
||||
BG_KEYS.forEach(function (key) {
|
||||
const el = document.getElementById(key);
|
||||
if (el) el.addEventListener("input", saveFromControls);
|
||||
});
|
||||
|
||||
document.getElementById("addSubreddit").addEventListener("click", function () {
|
||||
addSubredditEntry("", {});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user