spivurno
9/26/2011 - 6:53 PM

CSS to add line numbers to embedded gists

CSS to add line numbers to embedded gists

.gist-highlight {
    border-left: 3ex solid #eee;
    position: relative;
}

.gist-highlight pre {
    counter-reset: linenumbers;
}

.gist-highlight pre div:before {
    color: #aaa;
    content: counter(linenumbers);
    counter-increment: linenumbers;
    left: -3ex;
    position: absolute;
    text-align: right;
    width: 2.5ex;
}