Structural cleanup based on thermo-nuclear code quality review: - Extract shared color-picker.css and color-popover.css from badges.css (611→85 lines) - Extract shared lib/presets.js for preset CRUD used by popup and popover - Unify dark mode to single applyDarkModeClass on <html>, removing 4 scattered functions - Fix stale closure in startPostObserver, data-driven reload key check - Remove dead exports, getHelpers wrapper, duplicated colorToHex - Replace DOM expando properties with state array in popup.js Net: -318 lines of duplication, no file over 401 lines. Co-authored-by: Cursor <cursoragent@cursor.com>
86 lines
1.8 KiB
CSS
86 lines
1.8 KiB
CSS
/* --- FOUC prevention: hide original elements immediately --- */
|
|
html.rt-badges-enabled .thing.link .tagline .subreddit,
|
|
html.rt-badges-enabled .thing.link .flat-list li:has(> .comments) {
|
|
display: none !important;
|
|
}
|
|
|
|
/* --- Badge container --- */
|
|
.reddit-tweaks-badges {
|
|
margin-bottom: 4px;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
/* --- Shared badge styles --- */
|
|
.rt-badge {
|
|
display: inline-block;
|
|
border: 1px solid;
|
|
border-radius: 3px;
|
|
padding: 2px 6px;
|
|
font-size: 11px;
|
|
font-weight: bold;
|
|
text-decoration: none;
|
|
vertical-align: middle;
|
|
margin-right: 6px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.rt-badge:hover {
|
|
opacity: 0.8;
|
|
}
|
|
|
|
/* --- Subreddit badge: relative for gear positioning --- */
|
|
.rt-badge--subreddit {
|
|
position: relative;
|
|
padding-right: 6px;
|
|
transition: padding-right 0.15s;
|
|
background: var(--rt-sub-bg, #fde8e0);
|
|
border-color: var(--rt-sub-border, #c84a20);
|
|
color: var(--rt-sub-text, #c84a20);
|
|
}
|
|
|
|
.rt-badge--subreddit:hover {
|
|
padding-right: 18px;
|
|
}
|
|
|
|
.rt-badge--comments {
|
|
background: var(--rt-com-bg, #e0e0e0);
|
|
border-color: var(--rt-com-border, #4a4a4a);
|
|
color: var(--rt-com-text, #4a4a4a);
|
|
}
|
|
|
|
/* --- Dark mode --- */
|
|
.rt-dark .rt-badge--subreddit {
|
|
background: var(--rt-sub-bg, #3d2518);
|
|
border-color: var(--rt-sub-border, #ff6b3d);
|
|
color: var(--rt-sub-text, #ff6b3d);
|
|
}
|
|
|
|
.rt-dark .rt-badge--comments {
|
|
background: var(--rt-com-bg, #3a3a3a);
|
|
border-color: var(--rt-com-border, #888888);
|
|
color: var(--rt-com-text, #cccccc);
|
|
}
|
|
|
|
/* --- Gear icon --- */
|
|
.rt-badge-gear {
|
|
position: absolute;
|
|
right: 3px;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
font-size: 10px;
|
|
line-height: 1;
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
transition: opacity 0.15s;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.rt-badge--subreddit:hover .rt-badge-gear {
|
|
opacity: 0.6;
|
|
pointer-events: auto;
|
|
}
|
|
|
|
.rt-badge-gear:hover {
|
|
opacity: 1 !important;
|
|
}
|