fix(ui): 修好右下角运行中转圈的两段描边

上一轮把图标收进 sprite 后,转圈变成一个灰环:.scroll-bottom-btn .sb-spinner circle
和 ...path 是后代选择器,<use> 的内部元素在 shadow tree 里选不中,浅灰圆环与蓝色进度弧
的描边宽度、颜色全部回退成外层 svg 的 #556/2px。

改用 CSS 自定义属性穿透:--sb-ring / --sb-arc 定义在 .sb-spinner 上,symbol 里那两个元素
用 style 引用——presentation attribute 不解析 var(),必须写在 style 里。颜色仍归 CSS 管。

全量扫过一遍:CSS 里命中 svg 内部元素的后代选择器只有这一处,JS 里也没有 querySelector
直接改 path/circle 的写法。
This commit is contained in:
2026-11-13 16:00:26 +08:00
parent 8694061068
commit 67dff34a89
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -1107,9 +1107,9 @@ body.voice-active .scroll-bottom-btn { display: none; }
}
.scroll-bottom-btn:active { opacity: 1; }
.scroll-bottom-btn svg { width: 20px; height: 20px; fill: none; stroke: #556; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scroll-bottom-btn .sb-spinner { animation: sb-spin 0.8s linear infinite; }
.scroll-bottom-btn .sb-spinner circle { stroke: #dde; stroke-width: 2.5; fill: none; }
.scroll-bottom-btn .sb-spinner path { stroke: #3964FE; stroke-width: 2.5; stroke-linecap: round; fill: none; }
.scroll-bottom-btn .sb-spinner { --sb-ring: #dde; --sb-arc: #3964FE; animation: sb-spin 0.8s linear infinite; }
/* 圆环与蓝色进度弧的颜色用自定义属性传进 <use> 的 shadow tree:
后代选择器(.sb-spinner circle)选不中 symbol 里的元素,只有 CSS 变量能继承穿透。 */
@keyframes sb-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }