new-sakura:顶栏改半透明磨砂,并立规矩禁止全透明

线上(box.shiroko.one/_/tamakyi)两个现象来自同一处:`--tb-navbar` 是实色,
顶栏那条带(y=20..80)把从右上角长出来的花枝齐刷刷切掉一段。

第一版顺手改成 transparent —— 花枝完整了,但顶栏"消失":导航失去依托,
文字直接压在花纹上。用户当场否掉,要求半透明。

- 顶栏:`rgba(253,246,248,0.72)` / 深色 `rgba(34,26,30,0.72)`,配
  `.uk-navbar-container{backdrop-filter:blur(12px)}`(令牌只能是颜色,模糊写在规则里)。
  0.72 有依据:导航文字 #6d555d 纯底 6.34:1,最坏情况(深花瓣在顶栏后面)压平后 5.08:1。
- 花枝 top -16px → 26px:顶栏半透明后,700~760px 宽度下枝头正好压在「登录」上(截图确认)。
- 手机底栏 #tb-mobile-utils 在 base.css 写死 rgba(255,255,255,.92),粉底上是一条白杠,
  主题里改成同色系 0.92。
- 新增 TestNavbarNotFullyTransparent:拦 `transparent` / `rgba(...,0)` / `#rrggbb00`,
  并说明"这不是审美偏好,是踩过之后立的规矩"。变异验证过(改回 transparent 立即 FAIL)。
  约定同时写进 static/css/themes/_scaffold.css 的令牌说明。
- StaticVersion 20261022b → 20261022c:css 改了不提版本号,浏览器拿着旧样式,
  现象就是"改了但线上没变"。
This commit is contained in:
tamakyi
2026-10-22 16:05:37 +08:00
parent 2981731d4f
commit 8941744621
8 changed files with 163 additions and 10 deletions
+6 -2
View File
@@ -22,7 +22,11 @@
--tb-surface-2 次级面(标签底、进度条轨道、代码块)
--tb-surface-hover 悬停底(列表行、下拉项)
--tb-navbar 顶栏底色(不写则同 --tb-surface;
页面底色不是白时建议覆盖成 bg 或它的同色,否则顶栏会成为一条白带)
页面底色不是白时建议覆盖成 bg 或它的同色,否则顶栏会成为一条白带。
⚠️ 装饰层从页面角落长出来时,实色顶栏会把它齐刷刷切一段;
这时用半透明(如 rgba(...,.72))+ backdrop-filter: blur(),
但**不要写 transparent** —— 顶栏会失去依托,文字直接压在花纹上。
TestNavbarNotFullyTransparent 会拦住全透明。)
线条 --tb-border 边框、分隔线
文字 --tb-text 正文
--tb-text-secondary 次要文字(说明、meta、顶栏链接)
@@ -79,7 +83,7 @@ html[data-theme-style="SLUG"] {
--tb-surface: #ffffff;
--tb-surface-2: #f4f6f8;
--tb-surface-hover: #f3f7ff;
--tb-navbar: var(--tb-surface); /* 顶栏底色,需要时改成 var(--tb-bg) */
--tb-navbar: var(--tb-surface); /* 顶栏底色,需要时改成 var(--tb-bg) 或半透明的同色 */
--tb-border: #e8eaee;
--tb-text: #1f2329;
+20 -4
View File
@@ -24,7 +24,10 @@ html[data-theme-style="new-sakura"] {
--tb-surface: #ffffff;
--tb-surface-2: #fdf0f4;
--tb-surface-hover: #fff7fa;
--tb-navbar: #fdf6f8;
/* 顶栏做磨砂玻璃:樱花从角落长出来,实色顶栏会把它齐刷刷切一段;但也不能给
transparent —— 顶栏会"消失",导航失去依托,文字直接压在花纹上。留 28% 的透光。
模糊由下面「组件微调」里的 backdrop-filter 加(令牌只能给颜色)。 */
--tb-navbar: rgba(253, 246, 248, 0.72);
--tb-border: #f3dde5;
--tb-text: #3a2c31;
@@ -61,7 +64,7 @@ html[data-theme-style="new-sakura"] {
html[data-theme-style="new-sakura"][data-page-scope="box"] {
--tb-deco: var(--sk-branch-r), var(--sk-blossom), var(--sk-petal), var(--sk-petal), var(--sk-blossom), none, none, none, none, none;
--tb-deco-size: auto 300px, auto 80px, 34px, 24px, auto 52px, auto, auto, auto, auto, auto;
--tb-deco-position: right -24px top -16px, left 5% bottom 16%, left 14% bottom 32%, right 22% bottom 8%, right 6% bottom 6%, left top, left top, left top, left top, left top;
--tb-deco-position: right -24px top 26px, left 5% bottom 16%, left 14% bottom 32%, right 22% bottom 8%, right 6% bottom 6%, left top, left top, left top, left top, left top;
}
html[data-theme-style="new-sakura"][data-page-scope="question"] {
@@ -93,7 +96,7 @@ html[data-theme="dark"][data-theme-style="new-sakura"] {
--tb-surface: #2c2227;
--tb-surface-2: #372a30;
--tb-surface-hover: rgba(255, 147, 180, 0.10);
--tb-navbar: #221a1e;
--tb-navbar: rgba(34, 26, 30, 0.72);
--tb-border: #47333b;
--tb-text: #f3e6ea;
@@ -124,7 +127,7 @@ html[data-theme="dark"][data-theme-style="new-sakura"] {
html[data-theme="dark"][data-theme-style="new-sakura"][data-page-scope="box"] {
--tb-deco: var(--sk-branch-r), var(--sk-blossom), var(--sk-petal), var(--sk-petal), var(--sk-blossom), none, none, none, none, none;
--tb-deco-size: auto 300px, auto 80px, 34px, 24px, auto 52px, auto, auto, auto, auto, auto;
--tb-deco-position: right -24px top -16px, left 5% bottom 16%, left 14% bottom 32%, right 22% bottom 8%, right 6% bottom 6%, left top, left top, left top, left top, left top;
--tb-deco-position: right -24px top 26px, left 5% bottom 16%, left 14% bottom 32%, right 22% bottom 8%, right 6% bottom 6%, left top, left top, left top, left top, left top;
}
html[data-theme="dark"][data-theme-style="new-sakura"][data-page-scope="question"] {
@@ -193,3 +196,16 @@ html[data-theme-style="new-sakura"] .uk-alert-primary {
html[data-theme="dark"][data-theme-style="new-sakura"] .uk-alert-primary {
color: #ffb3c8;
}
/* 顶栏磨砂:半透明底由 --tb-navbar 给,模糊必须在这里加(令牌只能是颜色值)。
和手机底栏一样是「半透明 + 模糊」,不是全透明 —— 顶栏得看得见,只是后面透得出花。 */
html[data-theme-style="new-sakura"] .uk-navbar-container:not(.uk-navbar-transparent) {
-webkit-backdrop-filter: blur(12px);
backdrop-filter: blur(12px);
}
/* 手机底栏:base.css 写死 rgba(255,255,255,.92),压在粉底上是一条白杠,跟背景脱开 */
html[data-theme-style="new-sakura"] #tb-mobile-utils {
background: rgba(253, 246, 248, 0.92);
}
html[data-theme="dark"][data-theme-style="new-sakura"] #tb-mobile-utils {
background: rgba(34, 26, 30, 0.92);
}