Skip to content

Instantly share code, notes, and snippets.

@katendeglory
Last active August 5, 2020 11:10
Show Gist options
  • Save katendeglory/cf6eb160e3f273250fb5f3ea24fbd1f4 to your computer and use it in GitHub Desktop.
Save katendeglory/cf6eb160e3f273250fb5f3ea24fbd1f4 to your computer and use it in GitHub Desktop.
Custom scrollbar with css
html {
scroll-behavior: smooth;
width: 100%;
}
body {
width: 100%;
overflow-x: hidden;
overflow-y: overlay;
}
*::selection {
background-color: #EBCB8B;
opacity: .15;
color: white;
}
:root {
--bgScroll: transparent;
--thumbScroll: rgb(237, 242, 247);
}
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-button {
width: 0px;
height: 0px;
}
::-webkit-scrollbar-thumb {
background: var(--thumbScroll);
border-radius: 50px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--thumbScroll);
}
::-webkit-scrollbar-thumb:active {
background: var(--thumbScroll);
}
::-webkit-scrollbar-track {
background: transparent;
border-radius: 0px;
}
::-webkit-scrollbar-track:hover {
background: transparent;
}
::-webkit-scrollbar-track:active {
background: transparent;
}
::-webkit-scrollbar-corner {
background: transparent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment