Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
The syntax highlighting style in the code block is incorrect with Hugo ChromaThis issue occurs on Google Chrome and Safari browsers on Android, macOS, and Windows 11.

可以复现的网页:
- https://blog.dejavu.moe/posts/generate-har-in-browser-to-batch-download/
- https://blog.dejavu.moe/posts/show-live-photos-in-hugo/
Steps to reproduce
What have I done?
I have read:
- Using Hugo’s Syntax highlighter “chroma”
- [BUG] Code Block Font-Size not Matching · Issue #695 · adityatelange/hugo-PaperMod
- fix: Font size in the code block may be larger on iOS Safari by shimoju · Pull Request #1285 · adityatelange/hugo-PaperMod
- [BUG] On iOS mobile phone, the code block font size is not the same · Issue #828 · adityatelange/hugo-PaperMod
- [BUG] Chroma not rendering · Issue #1241 · adityatelange/hugo-PaperMod
I made the following changes to the Hugo configuration:
- Disable Highlight.js in
hugo.yaml
params: assets: disableHLJS: truepygmentsUseClasses: true ... markup: ...highlight: noClasses: falseanchorLineNos: truecodeFences: trueguessSyntax: truelineNos: truestyle: dracula- Gen a Chroma CSS style
hugo gen chromastyles --style dracula --highlightStyle 'bg:#1c1d21'> assets/css/extended/dracula.css- Add custom css style (assets/css/extended/custom.css)
.chroma{background-color: unset} /* Fixes iOS font sizing anomaly */code{text-size-adjust:100%; -ms-text-size-adjust:100%; -moz-text-size-adjust:100%; -webkit-text-size-adjust:100%}Hugo Version
Hugo >= 0.146.0 (Recommended - Minimum version required for PaperMod)
PaperMod Version
What kind of devices are you seeing the problem on?
Desktop
What browsers are you seeing the problem on?
Chrome
Browser Version
Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36
Relevant log output
There were no log errors or console reports when building the Hugo website.Repository/Source Code link where this issue can be reproduced
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working