Skip to content
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 block border does not match code block area #100

Closed
jonathanglassman opened this issue Sep 4, 2019 · 4 comments · Fixed by #108
Closed

Code block border does not match code block area #100

jonathanglassman opened this issue Sep 4, 2019 · 4 comments · Fixed by #108

Comments

@jonathanglassman
Copy link
Contributor

For example:

https://govukpay-docs-test-jfh.cloudapps.digital/making_payments/#creating-a-payment

Making payments   Pay

@jonheslop
Copy link
Contributor

Oh weird I didnt understand what you meant by this! What browser were you using because it doesn’t do this in Firefox, which is why I was confused

@jonathanglassman
Copy link
Contributor Author

Oh weird I didnt understand what you meant by this! What browser were you using because it doesn’t do this in Firefox, which is why I was confused

@jonheslop this happens in Chrome

@bravegrape
Copy link

@jonheslop also in Safari.

This reminds me of something @christophertomasdesign noticed about the tech docs template when he made a diagram for the docs. He said the text width in the tech docs template is around 100 px (?) larger than the text width on GOV.UK. Maybe the two are related?

@jonheslop
Copy link
Contributor

jonheslop commented Sep 5, 2019

This issue is caused by
https://github.com/alphagov/tech-docs-gem/blob/master/lib/assets/stylesheets/modules/_technical-documentation.scss#L122-L126

Which is seems like was a temp fix for another issue. I was just gonna remove the max-width: 40em until I saw the comment 🤔

But @bravegrape you’re probably right that the line length in general is probably too long but changing that doesn’t fix this issue.

Another fix would be to remove the wrapping div when ``` are used the markdown processor wraps the code with

<div class="highlight"><pre class="highlight javascript"><code>

The div seems unneccessary to me could just be

<pre class="highlight javascript"><code> or <div><pre class="highlight javascript"><code>

That would fix it but it looks like that is done by middleman-syntax gem and I don’t know enough ruby to fix this quickly

vixus0 added a commit that referenced this issue Sep 5, 2019
Fixes #100 -- the border now lines up with the bounds of the code block
and placing code blocks in table cells does not allow the table to grow
wider than the viewport. Overflowing text will be hidden in this case.
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

Successfully merging a pull request may close this issue.

3 participants