From 001306d94054e8fce96949216ae6be66eda5e5ee Mon Sep 17 00:00:00 2001 From: tamakyi Date: Wed, 21 Oct 2026 18:28:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=A0=B7=E5=BC=8F=E4=BB=A4?= =?UTF-8?q?=E7=89=8C=E5=8C=96=EF=BC=9A=E5=AD=97=E5=8F=B7=E8=90=BD=E5=88=B0?= =?UTF-8?q?=205=20=E6=A1=A3=E9=98=B6=E6=A2=AF=E3=80=81=E5=9C=86=E8=A7=92?= =?UTF-8?q?=E6=94=B9=E8=B5=B0=20--tb-radius?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 11 个模板里的硬编码字号/圆角换成令牌,为之后的深色与主题一致性打底。 字号(base.css 的 --tb-fs-xs/md/lg/xl/hero = 12/14/16/24/28): - 0.70~0.88rem、0.72rem 等五六档零碎值 → --tb-fs-xs(标签/meta) / --tb-fs-md(正文、列表、按钮) - 0.95~1rem → --tb-fs-lg;1.5rem 大数字 → --tb-fs-xl;1.75rem 首页主标题 → --tb-fs-hero - 以下几处**故意改变了观感**(不是等价替换,先记下来免得以后当 regression 查): explore 的 .explore-name 1.2rem → 1rem;.hot-vote-title 0.98 → 0.875; 首页 .tb-stat-num 手机端 1.25 → 1rem;.hot-vote-action 0.82 → 0.875(变大)。 圆角: - 8/9/10px → --tb-radius-sm(8) / --tb-radius(12,对话框与气泡);3/4/5/6px → --tb-radius-xs(6) - 头像 50%、胶囊 999px 保留原样(语义值,不是视觉随意值) 其它:header 验证码输入框边框 #ccc → var(--tb-border);chat 气泡与图片的圆角走内联 var()。 仍未令牌化(留给下一轮):templates/user/profile.html 还有 16 处 font-size、base.css 自身 11 处 (0.78/0.82/0.88/0.95/1.1),邮件模板 mail/* 保持 px 不动(邮件客户端不保证 var())。 --- templates/auth/register.html | 2 +- templates/base/header.html | 6 +++--- templates/chat/conversation.html | 6 +++--- templates/home.html | 26 +++++++++++------------ templates/question/item.html | 2 +- templates/question/list.html | 12 +++++------ templates/sponsor.html | 2 +- templates/user/explore.html | 34 +++++++++++++++---------------- templates/user/profile.html | 20 +++++++++--------- templates/user/question-list.html | 22 ++++++++++---------- templates/vote/page.html | 2 +- 11 files changed, 67 insertions(+), 67 deletions(-) diff --git a/templates/auth/register.html b/templates/auth/register.html index 9f31d39..e903113 100644 --- a/templates/auth/register.html +++ b/templates/auth/register.html @@ -4,7 +4,7 @@ background-color: #ffe0e0; color: #c0392b; padding: 0 4px; - border-radius: 4px; + border-radius: var(--tb-radius-xs); font-weight: 600; } html[data-theme="dark"] .tb-domain-sep { diff --git a/templates/base/header.html b/templates/base/header.html index 67f3f7f..9ad6e41 100644 --- a/templates/base/header.html +++ b/templates/base/header.html @@ -45,7 +45,7 @@ align-items: center; background: #f0f2f5; border: 1px solid #dcdcdc; - border-radius: 8px; + border-radius: var(--tb-radius-sm); padding: 8px 8px 8px 16px; gap: 6px; transition: border-color 0.2s; @@ -69,8 +69,8 @@ font-size: 1.2rem; font-family: "Courier New", monospace; font-weight: 600; - border: 1px solid #ccc; - border-radius: 5px; + border: 1px solid var(--tb-border); + border-radius: var(--tb-radius-sm); outline: none; transition: border-color 0.15s, box-shadow 0.15s; background: #fff; diff --git a/templates/chat/conversation.html b/templates/chat/conversation.html index 8d9fdc7..49b0439 100644 --- a/templates/chat/conversation.html +++ b/templates/chat/conversation.html @@ -20,7 +20,7 @@ .custom-lightbox img { max-width: 90%; max-height: 80%; - border-radius: 8px; + border-radius: var(--tb-radius-sm); box-shadow: 0 0 30px rgba(0,0,0,0.5); } .custom-lightbox .close-btn { @@ -59,7 +59,7 @@
  • + style="max-width: 75%; border-radius: var(--tb-radius); background-color: {{ if $isMyMessage }}#e6ffe6{{ else }}#f0f8ff{{ end }};" data-page-node-id="zPuwctcKF6xPKnwQKaYADD">
    @@ -78,7 +78,7 @@ {{ range (index $.MessageImages .ID) }}
    {{ .FileName }}
    {{ end }} diff --git a/templates/home.html b/templates/home.html index 9c7ba10..58952ad 100644 --- a/templates/home.html +++ b/templates/home.html @@ -9,7 +9,7 @@ } .tb-hero-title { margin: 0; - font-size: 1.75rem; + font-size: var(--tb-fs-hero); line-height: 1.35; font-weight: 600; color: var(--tb-text); @@ -17,7 +17,7 @@ .tb-hero-lead { margin: 12px auto 0; max-width: 30rem; - font-size: 0.95rem; + font-size: var(--tb-fs-lg); line-height: 1.8; color: var(--tb-text-muted); } @@ -43,13 +43,13 @@ } .tb-card-title { margin: 0 0 6px; - font-size: 0.98rem; + font-size: var(--tb-fs-lg); font-weight: 600; color: var(--tb-text); } .tb-card-text { margin: 0; - font-size: 0.86rem; + font-size: var(--tb-fs-md); line-height: 1.7; color: var(--tb-text-muted); } @@ -64,7 +64,7 @@ } .tb-section-title { margin: 0 0 10px; - font-size: 0.95rem; + font-size: var(--tb-fs-lg); font-weight: 600; color: var(--tb-text); } @@ -75,18 +75,18 @@ border-radius: var(--tb-radius-xs); background: var(--tb-primary-weak); color: var(--tb-primary); - font-size: 0.75rem; + font-size: var(--tb-fs-xs); } .tb-list { margin: 0; padding-left: 1.15em; - font-size: 0.9rem; + font-size: var(--tb-fs-md); line-height: 1.9; color: var(--tb-text); } .tb-changelog summary { cursor: pointer; - font-size: 0.9rem; + font-size: var(--tb-fs-md); font-weight: 600; color: var(--tb-text); list-style: none; @@ -108,7 +108,7 @@ } .tb-stat-num { display: block; - font-size: 1.5rem; + font-size: var(--tb-fs-xl); font-weight: 600; line-height: 1.3; color: var(--tb-text); @@ -116,20 +116,20 @@ .tb-stat-label { display: block; margin-top: 2px; - font-size: 0.78rem; + font-size: var(--tb-fs-xs); color: var(--tb-text-muted); } .tb-stats-meta { margin: 14px 0 0; - font-size: 0.78rem; + font-size: var(--tb-fs-xs); line-height: 1.8; color: var(--tb-text-muted); text-align: center; } @media (max-width: 480px) { .tb-hero { padding: 28px 16px 24px; } - .tb-hero-title { font-size: 1.4rem; } - .tb-stat-num { font-size: 1.25rem; } + .tb-hero-title { font-size: var(--tb-fs-xl); } + .tb-stat-num { font-size: var(--tb-fs-lg); } } diff --git a/templates/question/item.html b/templates/question/item.html index fe442a5..0367600 100644 --- a/templates/question/item.html +++ b/templates/question/item.html @@ -17,7 +17,7 @@ .tb-followup-card { border: 1px solid #e7e9ec; border-left: 3px solid #b0b6bd; - border-radius: 8px; + border-radius: var(--tb-radius-sm); padding: 12px 14px; background: #fbfbfc; } diff --git a/templates/question/list.html b/templates/question/list.html index 5b0af0d..6cbf5da 100644 --- a/templates/question/list.html +++ b/templates/question/list.html @@ -26,7 +26,7 @@ display: block; overflow: hidden; color: var(--tb-text); - font-size: 0.98rem; + font-size: var(--tb-fs-md); font-weight: 600; line-height: 1.45; text-overflow: ellipsis; @@ -39,11 +39,11 @@ gap: 7px; margin-top: 8px; } - .profile-vote-meta .uk-label { font-size: 0.72rem; line-height: 1.6; } + .profile-vote-meta .uk-label { font-size: var(--tb-fs-xs); line-height: 1.6; } .profile-vote-action { flex: 0 0 auto; color: var(--tb-primary); - font-size: 0.82rem; + font-size: var(--tb-fs-md); white-space: nowrap; } html[data-theme="dark"] .profile-vote-item { border-color: var(--tb-border); } @@ -58,18 +58,18 @@ margin-top: 20px; margin-bottom: 18px; border: 1px solid var(--tb-border); - border-radius: 9px; + border-radius: var(--tb-radius-sm); background: var(--tb-surface-2); } .profile-tab { flex: 1; border: 0; - border-radius: 6px; + border-radius: var(--tb-radius-xs); padding: 9px 15px; background: transparent; color: var(--tb-text-muted); cursor: pointer; - font-size: 0.9rem; + font-size: var(--tb-fs-md); transition: background 0.2s ease, color 0.2s ease; } .profile-tab:hover { color: var(--tb-primary); } diff --git a/templates/sponsor.html b/templates/sponsor.html index ae8c551..4e3a083 100644 --- a/templates/sponsor.html +++ b/templates/sponsor.html @@ -9,7 +9,7 @@ background: #eee; color: #fff; box-shadow: 0 0 5px 0 #ccc; - border-radius: 5px; + border-radius: var(--tb-radius-sm); line-height: 0; } diff --git a/templates/user/explore.html b/templates/user/explore.html index 7ea2376..7c6fa50 100644 --- a/templates/user/explore.html +++ b/templates/user/explore.html @@ -24,7 +24,7 @@ min-width: 0; } .explore-name { - font-size: 1.2rem; + font-size: var(--tb-fs-lg); font-weight: bold; margin-bottom: 5px; } @@ -38,7 +38,7 @@ .explore-intro { color: var(--tb-text-secondary); margin-bottom: 10px; - font-size: 0.9rem; + font-size: var(--tb-fs-md); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; @@ -61,7 +61,7 @@ align-items: center; padding: 10px; background: var(--tb-surface-2); - border-radius: 8px; + border-radius: var(--tb-radius-sm); transition: background 0.2s; } .recommend-card:hover { @@ -79,7 +79,7 @@ } .recommend-name { font-weight: bold; - font-size: 1rem; + font-size: var(--tb-fs-lg); } .recommend-name a { text-decoration: none; @@ -92,7 +92,7 @@ margin-top: 3px; } .recommend-tags .uk-label { - font-size: 0.7rem; + font-size: var(--tb-fs-xs); padding: 0 5px; } .hot-votes-list { @@ -109,7 +109,7 @@ min-width: 0; padding: 16px 18px; border: 1px solid var(--tb-border); - border-radius: 8px; + border-radius: var(--tb-radius-sm); background: var(--tb-surface-2); text-decoration: none; transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease; @@ -127,7 +127,7 @@ display: block; overflow: hidden; color: var(--tb-text); - font-size: 0.98rem; + font-size: var(--tb-fs-md); font-weight: 600; line-height: 1.45; text-overflow: ellipsis; @@ -141,13 +141,13 @@ margin-top: 8px; } .hot-vote-meta .uk-label { - font-size: 0.72rem; + font-size: var(--tb-fs-xs); line-height: 1.6; } .hot-vote-action { flex: 0 0 auto; color: var(--tb-primary); - font-size: 0.82rem; + font-size: var(--tb-fs-md); white-space: nowrap; } html[data-theme="dark"] .hot-vote-item { @@ -177,17 +177,17 @@ margin: 2px auto 20px; max-width: 320px; border: 1px solid var(--tb-border); - border-radius: 9px; + border-radius: var(--tb-radius-sm); background: var(--tb-surface-2); } .explore-tab { border: 0; - border-radius: 6px; + border-radius: var(--tb-radius-xs); padding: 8px 15px; background: transparent; color: var(--tb-text-secondary); cursor: pointer; - font-size: 0.9rem; + font-size: var(--tb-fs-md); transition: background 0.2s ease, color 0.2s ease; } .explore-tab:hover { color: var(--tb-primary); } @@ -209,12 +209,12 @@ .vote-random-btn { flex: 0 0 auto; border: 1px solid #dce9ff; - border-radius: 7px; + border-radius: var(--tb-radius-sm); padding: 7px 11px; color: var(--tb-primary); background: #f5faff; cursor: pointer; - font-size: 0.84rem; + font-size: var(--tb-fs-xs); } .vote-random-btn:hover { border-color: var(--tb-primary); background: #edf6ff; } .all-votes-list { display: grid; gap: 10px; } @@ -244,9 +244,9 @@ border-left: 4px solid var(--tb-primary); padding: 15px 20px; margin-bottom: 20px; - border-radius: 4px; + border-radius: var(--tb-radius-xs); color: var(--tb-text); - font-size: 0.9rem; + font-size: var(--tb-fs-md); line-height: 1.6; } .explore-notice strong { @@ -258,7 +258,7 @@ align-items: center; gap: 6px; padding: 5px 14px; - font-size: 0.85rem; + font-size: var(--tb-fs-md); line-height: 1.4; color: var(--tb-primary); background: transparent; diff --git a/templates/user/profile.html b/templates/user/profile.html index 65a20b5..4bc9481 100644 --- a/templates/user/profile.html +++ b/templates/user/profile.html @@ -36,7 +36,7 @@ background: #fff; padding: 20px; border: 1px solid var(--tb-border); - border-radius: 8px; + border-radius: var(--tb-radius-sm); text-align: center; } .preview-card .qrcode-wrapper { @@ -77,13 +77,13 @@ padding: 4px; margin-bottom: 18px; border: 1px solid var(--tb-border); - border-radius: 9px; + border-radius: var(--tb-radius-sm); background: var(--tb-surface-2); } .profile-tab { flex: 1; border: 0; - border-radius: 6px; + border-radius: var(--tb-radius-xs); padding: 9px 8px; background: transparent; color: var(--tb-text-muted); @@ -114,7 +114,7 @@ gap: 12px; padding: 16px; border: 1px solid var(--tb-border); - border-radius: 8px; + border-radius: var(--tb-radius-sm); background: #fff; } .feat-card-head { @@ -129,7 +129,7 @@ font-size: 0.72rem; line-height: 1.6; padding: 0 8px; - border-radius: 2px; + border-radius: var(--tb-radius-xs); } .feat-status.is-open { background: #32d296; color: #fff; } .feat-status.is-closed { background: #f0506e; color: #fff; } @@ -201,7 +201,7 @@ width: 130px; padding: 4px 8px; border: 1px solid var(--tb-border); - border-radius: 4px; + border-radius: var(--tb-radius-xs); } html[data-theme="dark"] .feat-day { border-color: var(--tb-border); @@ -260,7 +260,7 @@ gap: 6px; padding: 6px 8px; border: 1px solid var(--tb-border); - border-radius: 4px; + border-radius: var(--tb-radius-xs); background: #fff; cursor: text; } @@ -270,7 +270,7 @@ align-items: center; gap: 6px; padding: 2px 8px; - border-radius: 3px; + border-radius: var(--tb-radius-xs); background: var(--tb-primary); color: #fff; font-size: 0.875rem; @@ -317,7 +317,7 @@ .tb-pcard { background: var(--tb-surface); border: 1px solid var(--tb-border); - border-radius: 10px; + border-radius: var(--tb-radius-sm); padding: 13px 14px 8px; margin-bottom: 12px; } @@ -369,7 +369,7 @@ width: 267px; max-width: 100%; aspect-ratio: 16 / 9; - border-radius: 8px; + border-radius: var(--tb-radius-sm); } .tb-media-frame img { width: 100%; diff --git a/templates/user/question-list.html b/templates/user/question-list.html index 11e851a..2a7c6f4 100644 --- a/templates/user/question-list.html +++ b/templates/user/question-list.html @@ -9,18 +9,18 @@ margin: 6px auto 20px; max-width: 320px; border: 1px solid var(--tb-border); - border-radius: 9px; + border-radius: var(--tb-radius-sm); background: var(--tb-surface-2); } .qlist-tab { flex: 1 1 0; border: 0; - border-radius: 6px; + border-radius: var(--tb-radius-xs); padding: 8px 15px; background: transparent; color: var(--tb-text-secondary); cursor: pointer; - font-size: 0.9rem; + font-size: var(--tb-fs-md); transition: background 0.2s ease, color 0.2s ease; } .qlist-tab:hover { color: var(--tb-primary); } @@ -48,7 +48,7 @@ display: block; overflow: hidden; color: var(--tb-text); - font-size: 0.98rem; + font-size: var(--tb-fs-md); font-weight: 600; line-height: 1.45; text-overflow: ellipsis; @@ -62,8 +62,8 @@ gap: 7px; margin-top: 8px; } - .hot-vote-meta .uk-label { font-size: 0.72rem; line-height: 1.6; } - .hot-vote-action { flex: 0 0 auto; color: var(--tb-primary); font-size: 0.82rem; white-space: nowrap; } + .hot-vote-meta .uk-label { font-size: var(--tb-fs-xs); line-height: 1.6; } + .hot-vote-action { flex: 0 0 auto; color: var(--tb-primary); font-size: var(--tb-fs-md); white-space: nowrap; } /* 提问列表右上角:状态标签与操作按钮统一尺寸(等宽等高、垂直居中、完全对齐)。 每个元素显式带 .qlist-pill 类,选择器挂在 .qlist-pills 容器下提升优先级, 避免浏览器对