Skip to content

Instantly share code, notes, and snippets.

@sturmenta
Created March 10, 2024 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sturmenta/e4aa9d93efa76a695120cfc0fea2620b to your computer and use it in GitHub Desktop.
Save sturmenta/e4aa9d93efa76a695120cfc0fea2620b to your computer and use it in GitHub Desktop.
show / hide scroll - css
/* Hide scrollbar with class .hide-scroll */
/* for Chrome, Safari and Opera */
.hide-scroll::-webkit-scrollbar {
display: none;
/* Hide scrollbar for IE, Edge and Firefox */
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
/* Always show scrollbar with class .always-show-scroll */
/* show scrollbar -- https://stackoverflow.com/a/10100209 */
.always-show-scroll::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
}
.always-show-scroll::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0, 0, 0, 0.5);
box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment