Created
November 30, 2013 10:48
-
-
Save illarionvk/7717604 to your computer and use it in GitHub Desktop.
Remove vertical scrollbars from Jekyll syntax-highlighted code examples by adding 1px to the wrapper div height.
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
var codeblocks = document.getElementsByClassName('highlight'); | |
for (var i = 0; i < codeblocks.length; ++i) { | |
var item = codeblocks[i]; | |
// console.log("Old height:" + " " + item.offsetHeight); | |
item.style.height = item.offsetHeight + 1 + 'px'; | |
// console.log("New height:" + " " + item.offsetHeight); | |
} |
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
.highlight { | |
overflow: auto; | |
pre code { | |
font-weight: normal; | |
white-space: pre; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment