tomfran / typo

A simple Hugo theme
https://tomfran.github.io/
MIT License
237 stars 67 forks source link

Add markup highlight style to docs? #17

Closed vxnick closed 2 months ago

vxnick commented 2 months ago

I noticed that with a default configuration, syntax highlighting on the light/default theme can result in unreadable text (white text on a very light background).

I wasn't sure how best to fix this in CSS so I ended up looking at your website's repo and noticed you set a markup highlight style that also fixes this for me, so is this worth mentioning in the documentation if it can't be fixed with CSS directly?

tomfran commented 2 months ago

You mean using algol theme for syntax highlighting?

Strange, I don't see any problems setting it to my local website:

Screenshot 2024-09-02 at 22 47 43 Screenshot 2024-09-02 at 22 47 38

Perhaps I am missing something.

vxnick commented 2 months ago

Based on what I found, it looks like the highlighter's default style is monokai. I noticed you also override your style to bw so wondered if you had encountered the same issue originally.

To reproduce, either change markup.highlight.style = monokai or remove it from hugo.toml. This is what I saw until I set markup.highlight.style to something else.

Screenshot 2024-09-03 at 19 22 56

I see this on code blocks using bash and python formatting and also your own code block if I annotate it as Rust with <three-backticks>rust

Screenshot 2024-09-03 at 19 26 02

This works on plain backquoted code blocks without a language annotation.

Thanks!

tomfran commented 2 months ago

Thank you, I added a point to the wiki, perhaps this needs a proper fix.