Skip to content

Instantly share code, notes, and snippets.

@BrianHung
Last active May 30, 2024 06:08
Show Gist options
  • Save BrianHung/4003a7e43b5481fce351a44ccc0ec6e1 to your computer and use it in GitHub Desktop.
Save BrianHung/4003a7e43b5481fce351a44ccc0ec6e1 to your computer and use it in GitHub Desktop.
scrollbar.css
::-webkit-scrollbar {
height: 1rem;
width: 0.5rem;
}
::-webkit-scrollbar:horizontal {
height: 0.5rem;
width: 1rem;
}
::-webkit-scrollbar-track {
background-color: transparent;
border-radius: 9999px;
}
::-webkit-scrollbar-thumb {
--tw-border-opacity: 1;
background-color: hsla(0, 0%, 89%, 0.8);
border-color: rgba(255, 255, 255, var(--tw-border-opacity));
border-radius: 9999px;
border-width: 1px;
}
::-webkit-scrollbar-thumb:hover {
--tw-bg-opacity: 1;
background-color: rgba(227, 227, 227, var(--tw-bg-opacity));
}
.dark ::-webkit-scrollbar-thumb {
background-color: hsla(0, 0%, 100%, 0.1);
}
.dark ::-webkit-scrollbar-thumb:hover {
background-color: hsla(0, 0%, 100%, 0.3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment