style: reply hierarchy + cleaner reply-preview bar

- Replies with a reply_to target get left-border + indent (Discourse
  thread feel) via :has() selector
- Reply-box preview bar: removed blue box, now a clean bottom-border
  row (回复 @user + 取消 button)
- reply-to indicator: left border line, primary on hover
- Works in light & dark mode (uses --border/--text-light vars)
This commit is contained in:
lezi-fun committed 2026-08-11 21:22:20 +08:00
1 parent 4d0d5edec3
commit d9c4079619
2 files changed
+54 -12

No files matched your search

+49 -4
View File
@@ -3099,24 +3099,69 @@ a.btn-secondary {
.reply-btn { opacity: 0.8; }
}
/* ===== 回复指示器(Discourse 风格:正在回复 @xxx) ===== */
/* ===== 回复指示器(Discourse 风格:↩ 正在回复 @xxx) ===== */
.reply-to-indicator {
display: inline-flex;
align-items: center;
gap: 4px;
margin-top: 4px;
margin-left: 8px;
padding: 2px 8px 2px 4px;
font-size: 12px;
color: var(--text-light);
cursor: pointer;
transition: color 0.15s;
}
.reply-to-indicator .icon {
stroke: var(--text-light);
border-left: 2px solid var(--border);
}
.reply-to-indicator:hover {
color: var(--primary);
border-left-color: var(--primary);
}
.reply-to-indicator strong {
color: var(--primary);
font-weight: 600;
margin-left: 2px;
}
/* ===== 回复框预览横条(简洁无背景) ===== */
.reply-preview-bar {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 8px;
padding: 4px 0 8px;
border-bottom: 1px solid var(--border);
font-size: 13px;
color: var(--text-light);
}
.reply-preview-bar strong {
color: var(--primary);
font-weight: 600;
}
.reply-preview-cancel {
margin-left: auto;
background: none;
border: 1px solid var(--border);
border-radius: 4px;
cursor: pointer;
padding: 2px 10px;
color: var(--text-light);
font-size: 12px;
transition: all 0.15s;
}
.reply-preview-cancel:hover {
border-color: var(--primary);
color: var(--primary);
}
/* ===== 回复层次缩进(Discourse 嵌套风格) ===== */
/* 有回复目标的回复:左侧浅色线 + 缩进 */
.reply-item[data-username]:has(.reply-to-indicator) {
margin-left: 16px;
padding-left: 12px;
border-left: 2px solid var(--border);
border-radius: 0;
}
.reply-item[data-username]:has(.reply-to-indicator):hover {
border-left-color: var(--primary);
}
+5 -8
View File
@@ -129,14 +129,11 @@ export default function ReplyList({ postId, onRefresh }) {
<div id="replyArea" ref={replyAreaRef} style={{ marginTop: 24, borderTop: '1px solid var(--border)', paddingTop: 20 }}>
<h3 style={{ fontSize: 16, marginBottom: 12 }}><Icon name="message" size={16} /> 发表回复</h3>
{replyTo && (
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 8, padding: '6px 10px', background: 'var(--primary-light)', color: 'var(--primary)', borderRadius: 6, fontSize: 13 }}>
<Icon name="reply" size={13} /> 正在回复 <strong>@{replyTo}</strong>
<button
onClick={() => setReplyTo(null)}
style={{ marginLeft: 'auto', background: 'none', border: 'none', cursor: 'pointer', color: 'var(--text-light)', fontSize: 12 }}
>
取消
</button>
<div className="reply-preview-bar">
<Icon name="reply" size={13} />
<span>回复</span>
<strong>@{replyTo}</strong>
<button className="reply-preview-cancel" onClick={() => setReplyTo(null)}>取消</button>
</div>
)}
<textarea