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:
@@ -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); } }
|
||||
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
<symbol id="i-mic" viewBox="0 0 24 24"><rect x="9" y="2" width="6" height="12" rx="3"></rect><path d="M5 10a7 7 0 0 0 14 0"></path><line x1="12" y1="19" x2="12" y2="22"></line></symbol>
|
||||
<symbol id="i-keyboard" viewBox="0 0 24 24"><rect x="3" y="5" width="18" height="14" rx="2.5"></rect><circle cx="7" cy="9" r="1.1" fill="currentColor" stroke="none"></circle><circle cx="12" cy="9" r="1.1" fill="currentColor" stroke="none"></circle><circle cx="17" cy="9" r="1.1" fill="currentColor" stroke="none"></circle><circle cx="7" cy="12.5" r="1.1" fill="currentColor" stroke="none"></circle><circle cx="12" cy="12.5" r="1.1" fill="currentColor" stroke="none"></circle><circle cx="17" cy="12.5" r="1.1" fill="currentColor" stroke="none"></circle><line x1="8" y1="16" x2="16" y2="16"></line></symbol>
|
||||
<symbol id="i-chevron-down" viewBox="0 0 24 24"><polyline points="6 9 12 15 18 9"></polyline></symbol>
|
||||
<symbol id="i-spinner" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><path d="M22 12a10 10 0 0 1-10 10"></path></symbol>
|
||||
<symbol id="i-spinner" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" style="fill:none;stroke:var(--sb-ring,#dde);stroke-width:2.5"></circle><path d="M22 12a10 10 0 0 1-10 10" style="fill:none;stroke:var(--sb-arc,#3964FE);stroke-width:2.5;stroke-linecap:round"></path></symbol>
|
||||
<symbol id="i-search" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></symbol>
|
||||
<symbol id="i-gear" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"></circle><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path></symbol>
|
||||
<symbol id="i-upload-cloud" viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line></symbol>
|
||||
|
||||
Reference in New Issue
Block a user