Skip to content

Instantly share code, notes, and snippets.

@btleffler
Created June 28, 2012 20:20
Show Gist options
  • Save btleffler/3013673 to your computer and use it in GitHub Desktop.
Save btleffler/3013673 to your computer and use it in GitHub Desktop.
Cloud 9 Inconsolata Font
/*
* Because I love inconsolata
* Author: Benjamin Leffler
* Date: 06/28/12
*/
// ==UserScript==
// @match http://c9.io/*
// @match https://c9.io/*
// ==/UserScript==
(function() {
"use strict";
var styleSheets = document.styleSheets
, lastSheet = styleSheets.length - 1
, indexForNewRule, rules, sheet;
function addTheRule(sheet, index) {
if (sheet.addRule) {
sheet.addRule(".ace_editor", "font-family: inconsolata !important;", index);
} else {
sheet.insertRule(".ace_editor { font-family: inconsolata !important; }", index);
}
}
sheet = styleSheets[lastSheet];
if (sheet.cssRules) {
rules = sheet.cssRules;
} else {
rules = sheet.rules;
}
if (rules) {
indexForNewRule = rules.length;
addTheRule(sheet, indexForNewRule);
} else {
addTheRule(sheet, 0);
}
})();
// ==UserScript==
// @match http://c9.io/*
// @match https://c9.io/*
// ==/UserScript==
(function(){"use strict";function f(a,b){if(a.addRule){a.addRule(".ace_editor","font-family: inconsolata !important;",b);}else{a.insertRule(".ace_editor { font-family: inconsolata !important; }",b);}}var a=document.styleSheets,b=a.length-1,c,d,e;e=a[b];if(e.cssRules){d=e.cssRules;}else{d=e.rules;}if(d){c=d.length;f(e,c);}else{f(e,0);}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment