Skip to content

Instantly share code, notes, and snippets.

@mookid
Last active October 22, 2018 23:15
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 mookid/530eaa8aaccf4c40a72e200398e3612d to your computer and use it in GitHub Desktop.
Save mookid/530eaa8aaccf4c40a72e200398e3612d to your computer and use it in GitHub Desktop.
Tweak github fonts
// ==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