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:
2026-08-26 15:32:33 -04:00
parent 8be62e1fec
commit cca7940dd9
6 changed files with 55 additions and 33 deletions

View File

@@ -28,7 +28,7 @@
<h2>Light Mode Colors</h2>
<fieldset>
<legend>Subreddit Badge</legend>
<label>Background <input type="text" id="light.subredditBgColor"></label>
<label>Background <input type="color" id="light.subredditBgColor"></label>
<label>Border <input type="color" id="light.subredditBorderColor"></label>
<label>Text <input type="color" id="light.subredditTextColor"></label>
</fieldset>
@@ -45,7 +45,7 @@
<h2>Dark Mode Colors</h2>
<fieldset>
<legend>Subreddit Badge</legend>
<label>Background <input type="text" id="dark.subredditBgColor"></label>
<label>Background <input type="color" id="dark.subredditBgColor"></label>
<label>Border <input type="color" id="dark.subredditBorderColor"></label>
<label>Text <input type="color" id="dark.subredditTextColor"></label>
</fieldset>

View File

@@ -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("", {});
});