OT: How to change the highlight style based on prefers-color-scheme?

I’d like to switch the built-in highlight style based on the prefers-color-scheme, such that the codes will fit for the night mode as well.

Are there any solutions?

No. Not in Hugo itself. But you could create two different stylesheets for the highlights code:

And then do some magic on the prefers-color-scheme values?

This question is off-topic. Please have a look at the forum guidelines