3

is it possible to make gist embed script have vertical scroll bar? I want to embed my gist to my blog post, but it's a long code. I want my gist look like this in my blog post :

Scrollable code container

Lyan Dwi Pangestu
  • 463
  • 1
  • 7
  • 23

2 Answers2

8

The easiest solution is to add the following code to your CSS:

.gist-data{
    height:250px; // Any height
    overflow-y: visible;
}

This will limit the height of the gist's container, I tried other wrappers around it and this was the first one to limit the height.

Depending on specificity, you may need to add !important in your styles.

Greg McMullen
  • 989
  • 2
  • 16
  • 28
0

One WordPress project which provides that kind of feature would be "Embed GitHub Gist / Gist height (7 posts)".

I wanted to add a gist height for really long gists that would result in a scrollbar for the embed.
Here's the patch to achieve this for the current trunk using a height parameter to the shortcode.

The most recent version is at this project.

Some of that work might have been included in "dflydev/embed-github-gist".

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250