::-webkit-scrollbar,
::-webkit-scrollbar-corner {
  width: 17px;
  height: 17px;
  border: 0 solid divider($on-surface);
  background-color: rgba($surface-z8, .9);
}

::-webkit-scrollbar:horizontal,
::-webkit-scrollbar-corner {
  border-top-width: 1px;
}

::-webkit-scrollbar:vertical,
::-webkit-scrollbar-corner {
  border-left-width: 1px;
}

::-webkit-scrollbar {
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb {
  width: 32px;
  height: 32px;
  border: 4px solid transparent;
  border-radius: 8px;
  background-color: scrollbar-thumb($on-surface);
  background-clip: padding-box;

  &:horizontal {
    border-top-width: 5px;
    border-top-left-radius: 8px 9px;
    border-top-right-radius: 8px 9px;
  }

  &:vertical {
    border-left-width: 5px;
    border-top-left-radius: 9px 8px;
    border-bottom-left-radius: 9px 8px;
  }

  &:hover {
    background-color: scrollbar-thumb($on-surface, "hover");
  }

  &:active {
    background-color: scrollbar-thumb($on-surface, "pressed");
  }

  &:disabled {
    background-color: scrollbar-thumb($on-surface, "disabled");
  }
}

//
// Workaround: Chrome does not properly load selection style of GTK theme.
//

::selection {
  background-color: rgba(primary($on-light), .24);
}
