@mixin scrollbar($size: 7px, $color: rgba(0, 0, 0, 0.5), $dark-color: rgba(255, 255, 255, 0.5)) {
  scrollbar-width: thin;
  scrollbar-color: $color transparent;

  // Dark theme override
  .dark & {
    // guide safari use light color scrollbar
    color-scheme: dark;
    scrollbar-color: $dark-color transparent;
  }

  &::-webkit-scrollbar-thumb {
    background-color: $color;
    border-radius: $size;
  }
  &::-webkit-scrollbar-thumb:hover {
    background-color: $color;
    border-radius: $size;
  }
  &::-webkit-scrollbar {
    width: $size;
    height: $size;
  }
  &::-webkit-scrollbar-track-piece {
    background-color: rgba(0, 0, 0, 0);
    border-radius: 0;
  }
}
