Last active
October 22, 2018 23:15
-
-
Save mookid/530eaa8aaccf4c40a72e200398e3612d to your computer and use it in GitHub Desktop.
Tweak github fonts
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 Github font changer | |
// @namespace local.greasemonkey.githubfontchanger | |
// @include https://*github.com/* | |
// @include http://lists.gnu.org/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var fontdef = | |
"Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace"; | |
// Function helper to inject css | |
function addGlobalStyle(css) { | |
var head, style; | |
head = document.getElementsByTagName('head')[0]; | |
if (!head) { return; } | |
style = document.createElement('style'); | |
style.type = 'text/css'; | |
style.innerHTML = css; | |
head.appendChild(style); | |
} | |
// Apply the font-family definition to code styles. | |
addGlobalStyle( | |
'.blob-code-inner { font-family: ' + fontdef + '; } ' + | |
'.blob-code { font-family: ' + fontdef + '; } ' + | |
'.blob-num { font-family: ' + fontdef + '; } ' + | |
'pre { font-family: ' + fontdef + '; } ' + | |
''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment