lxndrblz / anatole

Anatole is a minimalistic two-column theme for Hugo.
https://themes.gohugo.io/themes/anatole/
MIT License
648 stars 355 forks source link

Misaligned first code line in code blocks #447

Open xjasonlyu opened 1 year ago

xjasonlyu commented 1 year ago

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 commented 1 year ago

The issue seems to be caused by this css layout:

https://github.com/lxndrblz/anatole/blob/1ac45419dcc725d4af83a411b94997370fd56d70/assets/scss/partials/components/_post.scss#L76-L85

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 commented 1 year ago

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;
}
lxndrblz commented 1 year ago

@xjasonlyu Is this issue still current?

xjasonlyu commented 1 year ago

Yes, it still exists.