How to Remain the style of Code block from editing and viewing?

What I’m trying to do

So, What I am trying to accomplish is to make the style of code block the same in editing and viewing mode.

This is in editing mode, which looks a lot nicer to me with different colors:

But in Viewing, it looks like everything is red. How to retain the style from edit mode and viewing mode?. I help is much appreciated. Thank you.

Things I have tried

I tried searching on the internet how to do it, but I can’t the right answer. I tried modifying the CSS styles but it’s not good, and I don’t like it.

It is stated by Obsidian that the library to handle code highlighting for reading mode and live preview mode is different. I’m annoyed by this also but we can’t really do anything about it. If I stumble on a different color between mode then I will manually inspect and fix the color. The only “solution”.