Fixing Github with Greasemonkey

Github is great, I really can’t say enough good things about them.  What’s not so great is their css, as it breaks badly if you change you dpi.  I finally found the root cause of this which is the search field gets squeezed vertically, and collides with the div under it, forcing that to the right, and forcing the right sidebar down.  I sent in some feedback, but am not sure if/when it might get applied.

So, in the short term I added the following greasemonkey script for github.com

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);
}

addGlobalStyle(‘#header .topsearch {width: 25em}’);

And voila, the site is readable again.

One thought on “Fixing Github with Greasemonkey”

  1. Interesting. I think something similar happens for me at opensimulator.org in Firefox. Setting the font size to 12 causes the left-hand sidebar to move way down.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s