Last active
June 7, 2020 10:05
-
-
Save tobimori/0daa6a1b332d756c5ddbcdaddb83b2a5 to your computer and use it in GitHub Desktop.
π Makes GitHub language tags funky! β¨ User script to replace the text color with the corresponding language color
This file contains hidden or 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 BetterLinguistColors | |
// @namespace https://moeritz.io/ | |
// @version 1.4.5 | |
// @description Replaces the text color with the corresponding language color | |
// @author Tobias MΓΆritz | |
// @match *://github.com/* | |
// @run-at document-start | |
// ==/UserScript== | |
new MutationObserver(() => { | |
[...document.querySelectorAll('span.repo-language-color')].map((e) => { | |
e.parentNode.childNodes[3].style.color = e.style.backgroundColor; | |
}); | |
[...document.querySelectorAll('span.color-block.language-color')].map((e) => { | |
e.parentNode.childNodes[3].style.color = e.style.backgroundColor; | |
e.parentNode.childNodes[5].style.color = e.style.backgroundColor; | |
e.parentNode.childNodes[5].style.opacity = '0.8'; | |
e.parentNode.childNodes[5].style.fontWeight = '500'; | |
}); | |
}).observe(document, { | |
childList: true, | |
subtree: true | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BetterLinguistColors
π Makes GitHub language tags funky! π
Click on Raw to install!
π Preview