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

Fix code padding in headings #1855

Merged
merged 1 commit into from
Jul 14, 2022
Merged

Fix code padding in headings #1855

merged 1 commit into from
Jul 14, 2022

Conversation

stevenengler
Copy link
Contributor

In #1806, extra padding was added to code blocks, but this adds the padding to headings as well. I think this was only meant to affect code blocks in the main content. If spacing was intended in the headings, a margin would probably be better. This PR just limits the scope of the change from #1806.

With this PR:

Before

1657647912_grim

After

1657648007_grim

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, apologies for the oversight.

@@ -252,7 +252,7 @@ pre > .buttons button {
padding: 0.3rem 1rem;
}
}
code {
p code {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look quite right to me. This padding should only be applied to code blocks which have the form:

<pre><code>…</code></pre>

p code would apply to almost everything except code blocks.

It seems to me that the rule should be something like:

Suggested change
p code {
pre > code {

(which also matches the other nearby rules.)

Copy link
Contributor Author

@stevenengler stevenengler Jul 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry I misunderstood the original PR. I've changed it to your suggestion, and amended it to the old commit.

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ehuss ehuss merged commit da166e0 into rust-lang:master Jul 14, 2022
@stevenengler stevenengler deleted the code-fmt branch July 14, 2022 14:32
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 this pull request may close these issues.

2 participants