Skip to content

Line spacing? #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
steveklabnik opened this issue Sep 13, 2018 · 4 comments
Closed

Line spacing? #269

steveklabnik opened this issue Sep 13, 2018 · 4 comments

Comments

@steveklabnik
Copy link
Member

steveklabnik commented Sep 13, 2018

from https://news.ycombinator.com/item?id=17980163 and https://www.reddit.com/r/rust/comments/9fjn8e/announcing_rust_129/e5wxixx/

@jonhoo , this is due to your tweaks here: #263

any idea how we should fix this?

I've reverted those changes until we can sort this.

steveklabnik added a commit that referenced this issue Sep 13, 2018
@jonhoo
Copy link
Contributor

jonhoo commented Sep 13, 2018

That's really weird -- it looks fine here too. This suggests there's a line-height property somewhere that's affecting the code samples, but I can't find one in our code. When line-height isn't set, underscores and the like should render just fine. It's a little hard to debug this now that it's been reverted. The quick-fix would be to add line-height: 1.5 to the pre, code rule in _sass/_base.css.

@reiner-dolp
Copy link
Contributor

reiner-dolp commented Sep 13, 2018

I think the core problem here is that background-color is set on pre code, because you are using the same style for <code> and <pre> tags. Highlighted differently for explanation:

image

Removing the background color from all code tags inside a pre tag will resolve the issue.

Demonstration of bug by narrowing line height:

image

Overdoing it for demonstration:
image

Bug fixed with transparent background on pre code:

image

@jonhoo
Copy link
Contributor

jonhoo commented Sep 13, 2018

Interesting.. I don't see how that'd cause the underscore to become invisible, but it's a worthwhile thing to try. Just put background-color only on pre (not code), and keep the patch otherwise the way it was, and it should be good.

@reiner-dolp
Copy link
Contributor

reiner-dolp commented Sep 13, 2018

@jonhoo I have added additional screenshots for explanation. Lines are rendered one after another. If the line-spacing becomes to tight the background of the current line will hide the bottom of the previous line (especially since the background is extended using a padding of 1px in height), which in our case hides the underscore.

I think #269 can be reapplied with an additional background: transparent; after line 143 in _base.css.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants