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> indentation error #26

Closed
eeev opened this issue Aug 16, 2023 · 2 comments
Closed

<code> indentation error #26

eeev opened this issue Aug 16, 2023 · 2 comments
Labels
bug Something isn't working v9

Comments

@eeev
Copy link

eeev commented Aug 16, 2023

Hello all,

I found a small design issue with the <code> blocks in this theme (you can also see it on the current preview image).

The code indentation on multi-line code blocks currently has a slight error:

  • For single-line blocks, using single backticks, applying a padding is fine, as is done in theme.css
  • For multi-line blocks, using triple backticks, since the very same padding as above is applied, this will break correct indentation; Multi-line blocks only use a single <code> block inside a <pre> block, especially for multi-line code

In the preview image, you can see that the mkdocs.yml-line is indented not by the code itself, but by the padding applied to the <code> block surrounding it. However, this padding does not translate over to the other \n's, hence the docs/-line beneath is not aligned.

My current fix is simply to override the css:

pre code {
    padding: 0;
}

For each <code> block nested inside a <pre> block, as is the case in multi-line blocks, the padding is reset. Alternatively, you may still add vertical padding, as it does not impact the indentation. In my personal blog, I have added this rule, and it seems to be fixing the issue.

Thank you for your time, please let me know what you think about this.

@FernandoCelmer
Copy link
Owner

FernandoCelmer commented Aug 16, 2023

@eeev Very good, I will confess that that space was bothering me but not to the point of correcting it hahahaha. I tested it and it was perfect, do you want to open a pull request please? Then I will generate a new version this week.

image

@FernandoCelmer FernandoCelmer added bug Something isn't working v9 labels Aug 16, 2023
FernandoCelmer added a commit that referenced this issue Aug 20, 2023
FernandoCelmer added a commit that referenced this issue Aug 20, 2023
FernandoCelmer added a commit that referenced this issue Aug 20, 2023
@FernandoCelmer
Copy link
Owner

@eeev
Alt Text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v9
Projects
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants