Browse Source

Fix scrollbar color mixin to use body color variable instead of RGB (#2246)

Paweł Kuna 5 tháng trước cách đây
mục cha
commit
4846828f39
2 tập tin đã thay đổi với 8 bổ sung3 xóa
  1. 5 0
      .changeset/twenty-moles-provide.md
  2. 3 3
      core/scss/mixins/_mixins.scss

+ 5 - 0
.changeset/twenty-moles-provide.md

@@ -0,0 +1,5 @@
+---
+"@tabler/core": patch
+---
+
+Fix scrollbar color mixin to use body color variable

+ 3 - 3
core/scss/mixins/_mixins.scss

@@ -15,7 +15,7 @@
 
 @mixin scrollbar($color: var(--#{$prefix}body-color-rgb)) {
   #{if(&, "&", "*")} {
-    scrollbar-color: rgba(var(--#{$prefix}scrollbar-color, var(--#{$prefix}body-color-rgb)), .16);
+    scrollbar-color: color-transparent(var(--#{$prefix}scrollbar-color, var(--#{$prefix}body-color)), .20);
   }
 
   #{if(&, "&", "*")}::-webkit-scrollbar {
@@ -27,7 +27,7 @@
   #{if(&, "&", "*")}::-webkit-scrollbar-thumb {
     border-radius: 1rem;
     border: 5px solid transparent;
-    box-shadow: inset 0 0 0 1rem rgba(var(--#{$prefix}scrollbar-color, var(--#{$prefix}body-color-rgb)), .16);
+    box-shadow: inset 0 0 0 1rem color-transparent(var(--#{$prefix}scrollbar-color, var(--#{$prefix}body-color)), .20);
   }
 
   #{if(&, "&", "*")}::-webkit-scrollbar-track {
@@ -35,7 +35,7 @@
   }
 
   #{if(&, "&", "*")}:hover::-webkit-scrollbar-thumb {
-    box-shadow: inset 0 0 0 1rem rgba(var(--#{$prefix}scrollbar-color, var(--#{$prefix}body-color-rgb)), .32);
+    box-shadow: inset 0 0 0 1rem color-transparent(var(--#{$prefix}scrollbar-color, var(--#{$prefix}body-color)), .40);
   }
 
   #{if(&, "&", "*")}::-webkit-scrollbar-corner {