Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Arty2
Last active April 7, 2019 09:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arty2/fdf19aea2c601032410516f059d58eb1 to your computer and use it in GitHub Desktop.
Save Arty2/fdf19aea2c601032410516f059d58eb1 to your computer and use it in GitHub Desktop.
Firefox CSS to style scrollbars to match Developer's theme. Use with userChrome.css
/*
scrollbars.as.css
based on https://userstyles.org/styles/128059/firefox-minimal-scrollbars
On Windows, save this file as: %APPDATA%\Mozilla\Firefox\Profiles ... /chrome/scrollbars.as.css
via: https://gist.github.com/Sporif/db6b3440fba0b1bcf5477afacf93f875
paste in userChrome.css in the /chrome folder mentioned above:
#PanelUI-menu-button {
-moz-binding: url(data:text/xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8IS0tIENvcHlyaWdodCAoYykgMjAxNyBIYWdnYWkgTnVjaGkNCkF2YWlsYWJsZSBmb3IgdXNlIHVuZGVyIHRoZSBNSVQgTGljZW5zZToNCmh0dHBzOi8vb3BlbnNvdXJjZS5vcmcvbGljZW5zZXMvTUlUDQogLS0+DQoNCjwhLS0gUnVuIHVzZXJDaHJvbWUuanMvdXNlckNocm9tZS54dWwgYW5kIC51Yy5qcy8udWMueHVsLy5jc3MgZmlsZXMgIC0tPg0KPGJpbmRpbmdzIHhtbG5zPSJodHRwOi8vd3d3Lm1vemlsbGEub3JnL3hibCI+DQogICAgPGJpbmRpbmcgaWQ9ImpzIiBleHRlbmRzPSJjaHJvbWU6Ly9nbG9iYWwvY29udGVudC9iaW5kaW5ncy90b29sYmFyYnV0dG9uLnhtbCNtZW51Ij4NCiAgICAgICAgPGltcGxlbWVudGF0aW9uPg0KICAgICAgICAgICAgPGNvbnN0cnVjdG9yPjwhW0NEQVRBWw0KICAgICAgICAgICAgICAgIGlmKHdpbmRvdy51c2VyQ2hyb21lSnNNb2QpIHJldHVybjsNCiAgICAgICAgICAgICAgICB3aW5kb3cudXNlckNocm9tZUpzTW9kID0gdHJ1ZTsNCiAgICAgICAgICAgICAgICANCiAgICAgICAgICAgICAgICB2YXIgY2hyb21lRmlsZXMgPSBGaWxlVXRpbHMuZ2V0RGlyKCJVQ2hybSIsIFtdKS5kaXJlY3RvcnlFbnRyaWVzOw0KICAgICAgICAgICAgICAgIHZhciB4dWxGaWxlcyA9IFtdOw0KICAgICAgICAgICAgICAgIHZhciBzc3MgPSBDY1snQG1vemlsbGEub3JnL2NvbnRlbnQvc3R5bGUtc2hlZXQtc2VydmljZTsxJ10uZ2V0U2VydmljZShDaS5uc0lTdHlsZVNoZWV0U2VydmljZSk7DQogICAgICAgICAgICAgICAgDQogICAgICAgICAgICAgICAgd2hpbGUoY2hyb21lRmlsZXMuaGFzTW9yZUVsZW1lbnRzKCkpIHsNCiAgICAgICAgICAgICAgICAgICAgdmFyIGZpbGUgPSBjaHJvbWVGaWxlcy5nZXROZXh0KCkuUXVlcnlJbnRlcmZhY2UoQ2kubnNJRmlsZSk7DQogICAgICAgICAgICAgICAgICAgIHZhciBmaWxlVVJJID0gU2VydmljZXMuaW8ubmV3RmlsZVVSSShmaWxlKTsNCiAgICAgICAgICAgICAgICAgICAgDQogICAgICAgICAgICAgICAgICAgIGlmKGZpbGUuaXNGaWxlKCkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKC8oXnVzZXJDaHJvbWV8XC51YylcLmpzJC9pLnRlc3QoZmlsZS5sZWFmTmFtZSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZXJ2aWNlcy5zY3JpcHRsb2FkZXIubG9hZFN1YlNjcmlwdFdpdGhPcHRpb25zKGZpbGVVUkkuc3BlYywge3RhcmdldDogd2luZG93LCBpZ25vcmVDYWNoZTogdHJ1ZX0pOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvKF51c2VyQ2hyb21lfFwudWMpXC54dWwkL2kudGVzdChmaWxlLmxlYWZOYW1lKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHh1bEZpbGVzLnB1c2goZmlsZVVSSS5zcGVjKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1wuYXNcLmNzcyQvaS50ZXN0KGZpbGUubGVhZk5hbWUpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXNzcy5zaGVldFJlZ2lzdGVyZWQoZmlsZVVSSSwgc3NzLkFHRU5UX1NIRUVUKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3NzLmxvYWRBbmRSZWdpc3RlclNoZWV0KGZpbGVVUkksIHNzcy5BR0VOVF9TSEVFVCk7DQogICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9eKD8hKHVzZXJDaHJvbWV8dXNlckNvbnRlbnQpXC5jc3MkKS4rXC5jc3MkL2kudGVzdChmaWxlLmxlYWZOYW1lKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFzc3Muc2hlZXRSZWdpc3RlcmVkKGZpbGVVUkksIHNzcy5VU0VSX1NIRUVUKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3NzLmxvYWRBbmRSZWdpc3RlclNoZWV0KGZpbGVVUkksIHNzcy5VU0VSX1NIRUVUKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICANCiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uIGxvYWRYVUwoKSB7DQogICAgICAgICAgICAgICAgICAgIGlmKHh1bEZpbGVzLmxlbmd0aCA+IDApIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmxvYWRPdmVybGF5KHh1bEZpbGVzLnNoaWZ0KCksIG51bGwpOw0KICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChsb2FkWFVMLCA1KTsNCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0sIDApOw0KICAgICAgICAgICAgXV0+PC9jb25zdHJ1Y3Rvcj4NCiAgICAgICAgPC9pbXBsZW1lbnRhdGlvbj4NCiAgICA8L2JpbmRpbmc+DQo8L2JpbmRpbmdzPg==);
}
*/
scrollbar {
z-index: 999;
position: relative !important;
transition: all 0s !important;
}
scrollbar,
scrollbar * {
-moz-appearance: none !important;
margin: 0px !important;
padding: 0px !important;
border: 0px !important;
box-shadow: none !important;
}
:not(select)>scrollbar[orient="vertical"],
html>scrollbar[orient="vertical"] {
-moz-margin-start: -12px !important;
max-width: 12px !important;
min-width: 12px !important;
background: linear-gradient( rgba(0,0,0,0), rgba(0,0,0,0) );
background-size: 1px 1px;
background-repeat: repeat-y !important;
background-position: 50% 0% !important;
cursor: row-resize;
}
scrollbar[orient="horizontal"] {
margin-top: -12px !important;
max-height: 12px !important;
min-height: 12px !important;
background: linear-gradient( rgba(0,0,0,0), rgba(0,0,0,0) );
background-size: 1px 1px;
background-repeat: repeat-x;
background-position: 0% 50%;
cursor: col-resize;
}
scrollbar thumb[orient="vertical"] {
min-height: 24px !important;
width: 12px !important;
min-width: 12px !important;
max-width: 12px !important;
}
scrollbar thumb[orient="horizontal"] {
min-width: 24px !important;
height: 12px !important;
min-height: 12px !important;
max-height: 12px !important;
}
scrollbar thumb {
border-radius: 6px !important;
background: transparent !important;
border: 2px solid rgba(0,255,255,0) !important;
box-shadow: 0 0 0 8px #272b35 inset !important;
transition: all 0s !important;
opacity: 0.1 !important;
}
scrollbar:hover thumb,
scrollbar thumb:active {
box-shadow: 0 0 0 8px #cd23b9 inset !important;
opacity: 1 !important;
}
/* no buttons */
scrollbar scrollbarbutton{
min-height: 0px !important;
min-width: 0px !important;
max-height: 12px !important;
max-width: 12px !important;
height: 0px !important;
width: 0px !important;
}
/* autohide */
/*scrollbar:not(:hover) {
opacity: 0 !important;
transition: all .5s !important;
}*/
@Arty2
Copy link
Author

Arty2 commented Sep 29, 2018

See https://gist.github.com/Sporif/db6b3440fba0b1bcf5477afacf93f875 for a simpler solution that doesn't require userChrome.js in Firefox 57+ and https://github.com/Izheil/Firefox-57-full-dark-theme-with-scrollbars for multiple other stylesheets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment