Răsfoiți Sursa

fix(web): 调整滚动条透明度并修复悬停样式

sy 3 zile în urmă
părinte
comite
3effc9b4a9
2 a modificat fișierele cu 12 adăugiri și 4 ștergeri
  1. 8 0
      web-scaffold/src/styles/globals.css
  2. 4 4
      web-scaffold/src/styles/tokens.css

+ 8 - 0
web-scaffold/src/styles/globals.css

@@ -81,6 +81,14 @@
   scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
 }
 
+@supports selector(::-webkit-scrollbar-thumb) {
+  * {
+    /* 标准属性取非 auto 时会覆盖伪元素,含组件单独设置的 thin。 */
+    scrollbar-width: auto !important;
+    scrollbar-color: auto;
+  }
+}
+
 *::-webkit-scrollbar {
   width: 9px;
   height: 9px;

+ 4 - 4
web-scaffold/src/styles/tokens.css

@@ -95,8 +95,8 @@
   --shadow-panel: 0 18px 60px rgb(16 24 40 / 12%);
   --shadow-dialog: 0 24px 80px rgb(16 24 40 / 18%);
   --shadow-toast: 0 8px 24px rgb(16 24 40 / 22%);
-  --scrollbar-thumb: #80999f;
-  --scrollbar-thumb-hover: #4d7778;
+  --scrollbar-thumb: rgb(128 153 159 / 26%);
+  --scrollbar-thumb-hover: rgb(77 119 120 / 32%);
   --scrollbar-track: transparent;
   --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23617783' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
 }
@@ -153,7 +153,7 @@
   --shadow-panel: 0 18px 60px rgb(0 0 0 / 28%);
   --shadow-dialog: 0 20px 80px rgb(0 0 0 / 44%);
   --shadow-toast: 0 6px 25px rgb(0 0 0 / 32%);
-  --scrollbar-thumb: #607f85;
-  --scrollbar-thumb-hover: #91b7b4;
+  --scrollbar-thumb: rgb(96 127 133 / 23%);
+  --scrollbar-thumb-hover: rgb(145 183 180 / 29%);
   --scrollbar-track: transparent;
 }