Created
November 14, 2024 20:36
-
-
Save nx10/695be29a80912e44a54a2af97733bf59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Overleaf Code Editor: Dark Scrollbar | |
// @namespace http://tampermonkey.net/ | |
// @version 1.1 | |
// @description Adds a dark scrollbar to the Overleaf Code Editor | |
// @author nx10 | |
// @license MIT | |
// @match https://www.overleaf.com/project/* | |
// @run-at document-start | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const scrollbarStyles = ` | |
/* Scrollbar styles */ | |
::-webkit-scrollbar { | |
width: 12px; | |
} | |
::-webkit-scrollbar-track { | |
background: #1e2632; | |
border-radius: 6px; | |
} | |
::-webkit-scrollbar-thumb { | |
background: #3a4655; | |
border-radius: 6px; | |
border: 2px solid #1e2632; | |
} | |
::-webkit-scrollbar-thumb:hover { | |
background: #4a5a70; | |
} | |
/* For Firefox */ | |
* { | |
scrollbar-width: thin; | |
scrollbar-color: #3a4655 #1e2632; | |
} | |
`; | |
function addGlobalStyle(css) { | |
const style = document.createElement('style'); | |
style.type = 'text/css'; | |
style.textContent = css; | |
(document.head || document.documentElement).appendChild(style); | |
} | |
addGlobalStyle(scrollbarStyles); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment