reorx / hugo-PaperModX

A fast, clean, responsive Hugo theme.
https://reorx.github.io/hugo-PaperModX/
MIT License
318 stars 84 forks source link

[BUG] The code in code block can't align with the line number in iOS mobile devices #22

Closed Triple-Z closed 1 year ago

Triple-Z commented 2 years ago

Describe the bug

Steps to reproduce the behavior:

Use a browser(no matter what: Safari, Firefox or Chrome) in an iOS mobile device to open a page that has a least one code block with line numbers.

Expected behavior:

The code lines should align with the line numbers.

Screenshots

Safari: image

Firefox: image

Chrome: image

If you disable the markup.highlight.lineNos in config.yaml, the code is fine with line numbers: image

Additional context

If you need further testing, feel free to use this example page: https://58bed0b1.my-hugo-blog.pages.dev/posts/chaosblade-specific-cpu-load/

drowzy commented 1 year ago

I had a similar issue with variable font-sizes on ios devices. The fix outlined here: https://github.com/adityatelange/hugo-PaperMod/issues/828#issuecomment-1171994855 solved it for me.

code {
    text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}
Triple-Z commented 1 year ago

@drowzy thx very much, this solution works!