cleanup: default accent color baked into .chat-viewer-user — kills one branch of inline-style fallback
renderChatList in renderer.ts was setting uSpan.style.color twice: once with the per-user IRC color when m.color was present, and once as a fallback to var(--accent) when it wasn't. The fallback is exactly the styling .chat-viewer-user should own by default. Moved color: var(--accent) into the .chat-viewer-user CSS rule next to its font-weight + margin-right. The renderer's per-user color override stays inline because it's truly dynamic (parsed from chat IRC payload), but the no-color path no longer needs to assign anything — the class default takes over. One inline .style.color assignment + one else branch gone, semantics preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e951c6a852
commit
ba872e2ecf
@ -512,9 +512,9 @@ function renderChatViewerList(messages: ChatViewerMessage[]): void {
|
|||||||
if (user) {
|
if (user) {
|
||||||
const uSpan = document.createElement('span');
|
const uSpan = document.createElement('span');
|
||||||
uSpan.className = 'chat-viewer-user';
|
uSpan.className = 'chat-viewer-user';
|
||||||
// Per-user IRC color is preserved; the class supplies weight.
|
// Per-user IRC color overrides the default accent colour
|
||||||
|
// supplied by .chat-viewer-user; the class also sets weight.
|
||||||
if (m.color) uSpan.style.color = m.color;
|
if (m.color) uSpan.style.color = m.color;
|
||||||
else uSpan.style.color = 'var(--accent)';
|
|
||||||
uSpan.textContent = `${user}:`;
|
uSpan.textContent = `${user}:`;
|
||||||
row.appendChild(uSpan);
|
row.appendChild(uSpan);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3823,6 +3823,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||||||
.chat-viewer-row .chat-viewer-user {
|
.chat-viewer-row .chat-viewer-user {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-viewer-row .chat-viewer-tag {
|
.chat-viewer-row .chat-viewer-tag {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user