From d9c40796193792ac9bc1850b8494e32181452966 Mon Sep 17 00:00:00 2001 From: lezi-fun <177434121+lezi-fun@users.noreply.github.com> Date: Tue, 11 Aug 2026 21:22:20 +0800 Subject: [PATCH] style: reply hierarchy + cleaner reply-preview bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- app/globals.css | 53 +++++++++++++++++++++++++++++++++++++---- components/ReplyList.js | 13 ++++------ 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/app/globals.css b/app/globals.css index f92a365..a903e85 100644 --- a/app/globals.css +++ b/app/globals.css @@ -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); } diff --git a/components/ReplyList.js b/components/ReplyList.js index a028afc..71c1b26 100644 --- a/components/ReplyList.js +++ b/components/ReplyList.js @@ -129,14 +129,11 @@ export default function ReplyList({ postId, onRefresh }) {

发表回复

{replyTo && ( -
- 正在回复 @{replyTo} - +
+ + 回复 + @{replyTo} +
)}