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

Misaligned first code line in code blocks #447

Closed
xjasonlyu opened this issue Apr 17, 2023 · 4 comments · Fixed by #507
Closed

Misaligned first code line in code blocks #447

xjasonlyu opened this issue Apr 17, 2023 · 4 comments · Fixed by #507
Assignees
Labels
bug Something isn't working

Comments

@xjasonlyu
Copy link
Contributor

xjasonlyu commented Apr 17, 2023

Taking the demo site as an example, the first line in the code block is slightly misaligned compared to the rest:

Screenshot 2023-04-17 at 11 19 10 PM

This issues applies to all the clode blocks and styles too.

@xjasonlyu xjasonlyu added the bug Something isn't working label Apr 17, 2023
@xjasonlyu
Copy link
Contributor Author

The issue seems to be caused by this css layout:

code {
font-family: monospace;
padding: 0 2px;
@include themed() {
background-color: t('primary-lighter');
border: 1px solid t('primary-lighter');
border-radius: 2px;
}
}

the 2px padding and 1px border were combined and added to the head and tail of the code block, which contributes to this misaligned layout.

@xjasonlyu
Copy link
Contributor Author

xjasonlyu commented Apr 19, 2023

Adding this css code into custom.css works for me, but yet I don't know why. I'm not familiar with CSS ;-)

.post__content code {
    line-height: 1.9rem;
    display: inline-block;
}

xjasonlyu added a commit to xjasonlyu/xjasonlyu.github.io that referenced this issue Apr 19, 2023
@lxndrblz
Copy link
Owner

@xjasonlyu Is this issue still current?

@xjasonlyu
Copy link
Contributor Author

Yes, it still exists.

@lxndrblz lxndrblz linked a pull request Jul 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants