-
Notifications
You must be signed in to change notification settings - Fork 62
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
Code is less than 80 chars wide #31
Comments
I agree. In the meantime, several of the tutorials look kind of skewed. |
I see this problem with most of the tutorials. I'm using Firefox on windows 7. Would this pull request fix the problem? |
Seems the current width is seldom quite right, then, seeing as we currently have reports of this happening in both Chrome and Firefox on Linux, OS X and Windows. @robochat #33 may well fix it in many cases, though the new number also seems rather arbitrary/unreliable. Unless I'm mistaken, The Another alternative would be Javascript; to programmatically measure the width of a character and change the width of the code section to hold 80 of them. A reasonable default would of course be kept in the CSS as fallback. |
Yes |
Absolutely, I totally agree. In my opinion, any change that improves the situation is a step in the right direction, even if it may not work for all OS/browser combinations. Perhaps I should've made that clearer in my last reply. My intent was just to mention the potential for remaining issues - I'd nonetheless like to see #33 accepted. |
Sounds like a complicated way to avoid |
@sshine Avoid |
I no longer see this problem when I view the site on safari or firefox. So I'm not sure why it is not working for you. Actually, I think that the problem with the red tutorial is that the lines are longer than 80 characters. |
Does adambard/learnxinyminutes-docs#2611 also describe behavior from this issue or is it a separate thing? |
@Oire Seems like it's the same problem, but a different proposed solution. |
Not sure if this belongs in a separate issue. I often find myself trying to read learnxinyminutes.com on my mobile, and with the lines wrapping it's quite hard (especially in portrait mode). One potential solution could be to avoid line wrapping and let content overflow on the x-axis, similar to how inline code blocks behave inside Markdown files on GitHub? This could be solved by adding a CSS rule like below. .highlight pre {
overflow-x: auto;
white-space: pre;
} Perhaps I'm missing something essential here, any reason this would be a bad idea? |
The content area's width of 840px is not sufficiently wide to accommodate 80 characters per line when using Chrome on a completely fresh install of Linux Mint 17.3. Specifically, only 70 characters are displayed per line using this setup.
The same effect is also observed using Chromium, and on Kubuntu 15.10. The issue is thus likely seen in other Chromium-based browsers and on other Ubuntu-based distros as well.
The problem seems to arise due to a slightly larger letter spacing when using the aforementioned combinations, perhaps due to differences in the underlying font rendering engines.
The simplest solution would be to increase the width of the content container (to approximately 950px). Another alternative could be to reduce the letter spacing in the code section (by approximately 0.013em). However, both of these solutions would also affect other platforms where this issue isn't present, perhaps making it somewhat less straight-forward depending on the project's priorities.
The text was updated successfully, but these errors were encountered: