Opened 4 months ago

Last modified 4 weeks ago

#23184 new enhancement

Twenty Eleven/Twelve: Mismatched lines in GitHub Gists

Reported by: obenland Owned by:
Priority: lowest Milestone: WordPress.org
Component: Bundled Theme Version: 3.5
Severity: normal Keywords: close
Cc: DrewAPicture

Description

GitHub Gists are displayed with the code and line numbers misaligned, due to the difference in font-size and/or line-height of <pre> and <table> elements.

Originally reported in this thread and on wp.com.

Example: http://themebuster.wordpress.net/gist-test/

Attachments (1)

23184.diff (1.1 KB) - added by obenland 4 months ago.

Download all attachments as: .zip

Change History (11)

comment:1 follow-ups: ↓ 2 ↓ 3   lancewillett4 months ago

So, while I'd love to fix this, I'd vote that this specific of a fix should be in the plugin itself, not in the default theme stylesheet.

comment:2 in reply to: ↑ 1   DrewAPicture4 months ago

  • Cc DrewAPicture added

23184.diff looks sane to me and I like it a lot better than all-out usurping the <pre> styles.

Replying to lancewillett:

So, while I'd love to fix this, I'd vote that this specific of a fix should be in the plugin itself, not in the default theme stylesheet.

Are you talking about upstream?

comment:3 in reply to: ↑ 1   obenland4 months ago

Replying to lancewillett:

So, while I'd love to fix this, I'd vote that this specific of a fix should be in the plugin itself, not in the default theme stylesheet.

I'm confused. I thought your example Gist test on themebuster is using the JavaScript embed provided by GitHub, no?

I can reproduce it in a local test with the javascript method.

Admitted, it is a prettic specific fix. While we provide custom code for third party services like Twitter and Jetpack, it could be argued that those are more likely to be tied in, than a Gist.

  • Keywords close added
  • Milestone changed from Awaiting Review to 3.6

Marking as "close" based on looking at the original thread: http://wordpress.org/support/topic/gists-look-crazy-with-twenty-twelve -- and looking at the URLs, the layout looks fixed in the plugin now.

comment:6 follow-up: ↓ 7   lancewillett3 months ago

I think we should ping Github team and ask them to update the embedded CSS to account for line-height and font-size. That way instead of just patching this one theme -- it'll work great everywhere.

comment:7 in reply to: ↑ 6   DrewAPicture3 months ago

Replying to lancewillett:

I think we should ping Github team and ask them to update the embedded CSS to account for line-height and font-size. That way instead of just patching this one theme -- it'll work great everywhere.

+1

  • Keywords has-patch removed
  • Priority changed from normal to lowest
  • Milestone changed from 3.6 to WordPress.org

Will loop back on this after 3.6 is stable.

This really shouldn't be an issue of manually specifying a line height. It can be easily resolved with:

.gist pre {

font: inherit;
line-height: inherit;
white-space: pre;

}

(The white-space: pre is to resolve a twentythirteen issue, where the lines can wrap and then not match up with the numbers)

Note: See TracTickets for help on using tickets.